Raised This Month: $51 Target: $400
 12% 

[TF2] Real-Time Strategy Camera Controls


Post New Thread Reply   
 
Thread Tools Display Modes
Author
AI_
Member
Join Date: Oct 2014
Location: Canada
Plugin ID:
8563
Plugin Version:
Plugin Category:
Technical/Development
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Proof-of-concept implementation for Real-Time Strategy (RTS) camera controls
    Old 10-06-2023 , 07:02   [TF2] Real-Time Strategy Camera Controls
    Reply With Quote #1

    This is a proof-of-concept implementation for a Real-Time Strategy (RTS) camera control setup with support for screen-space to world-space point-and-click selection. It is written in pure SourcePawn and only requires SourceMod running on a Team Fortress 2 server.

    Please note the cursor and other movement speeds and sensitivity settings have been hard-coded and should be edited and configured for your implementation. Users may also have specific preferences that depend on game settings and server latency.

    Custom bots used during testing and demonstration are not part of this release.

    Features
    • Edge scrolling
    • WASD-keys scrolling
    • Drag-to-scroll (hold right mouse button and drag)
    • Zooming (scroll with mouse wheel, see below for binds)
    • Rotation (hold mouse wheel down and drag, can be used while scrolling for fly-through)
    • Clip camera angles and movements to bounding box
    • Left-click to select units (drag rectangle to select multiple)
    • Right-click to apply an action to selected units
    • Colored health bars drawn above selected unit entities that are visible through walls

    Demonstration Videos



    Commands
    Code:
    sm_rts [min_x min_y min_z max_x max_y max_z] - Enter and exit RTS mode
    sm_rts_zoom_in                               - Camera zoom in
    sm_rts_zoom_out                              - Camera zoom out
    
    sm_rts_aspect_ratio <ratio>                  - Set camera aspect ratio
    sm_rts_aspect_ratio <width> <height>         - Set camera aspect ratio calculated with width and height
    Recommended Binds
    Code:
    bind MWHEELUP sm_rts_zoom_in
    bind MWHEELDOWN sm_rts_zoom_out
    Example Test Map

    This project was developed and tested on jump_academy_classic_b inside the Market Gardening Arena (MGA) part of the map. Use the sm_rts command with the corresponding bounding box values as follows to start:

    Code:
    sm_rts 6680 -3750 -1035 10200 -300 785
    Dependencies
    • SourceMod 1.12.0.7038 or newer
    • SMLib

    Download via GitHub Repository:
    __________________

    Last edited by AI_; 10-06-2023 at 07:04.
    AI_ is offline
    artvin_boy
    Junior Member
    Join Date: Sep 2020
    Location: Ottoman Empire
    Old 10-06-2023 , 12:12   Re: [TF2] Real-Time Strategy Camera Controls
    Reply With Quote #2

    yoooo this is cool
    __________________
    Sup.
    artvin_boy is offline
    Fearts
    ferts of daeth
    Join Date: Oct 2008
    Old 10-14-2023 , 17:46   Re: [TF2] Real-Time Strategy Camera Controls
    Reply With Quote #3

    This is really interesting. Nice work.
    __________________
    Fearts is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 10-15-2023 , 05:58   Re: [TF2] Real-Time Strategy Camera Controls
    Reply With Quote #4

    Damn...
    __________________
    Want to check my plugins ?
    Arkarr is offline
    nergal
    Veteran Member
    Join Date: Apr 2012
    Old 10-15-2023 , 14:53   Re: [TF2] Real-Time Strategy Camera Controls
    Reply With Quote #5

    pretty cool. I had an idea like this many years back to do an RTS/MOBA with TF2.
    __________________
    nergal is offline
    Fearts
    ferts of daeth
    Join Date: Oct 2008
    Old 10-17-2023 , 15:14   Re: [TF2] Real-Time Strategy Camera Controls
    Reply With Quote #6

    Do you think this could be made to work with NPCs instead of Bots?
    __________________
    Fearts is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 08:49.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode