svott Posted January 3, 2016 Report Share Posted January 3, 2016 Hey guys,I'd like to implement a patrol movement http://trac.wildfiregames.com/ticket/1720But I think a small discussion about implementation details could be useful.I know that you can already queue movements/tasks for a unit by pressing the shift key.Hence, it should be not so elaborate to implement a patrol movement.I guess every unit has a FIFO queue as a data structure for planned movements!?So my suggestion is that a small piece of code checks whether the first (next) entry of the queue is equal to the last on.If yes, we have a patrol movement and the first entry should be appended to the end when this point is reached.Does somebody knows where that queue is implemented (before I spend too much time with searching )._______Additionally, I suggest visualising the entries of the queue in a different task. Otherwise, it would be very complicated to hit the first position again(probably a small tolerance range must be implemented to simply hitting the begin) 1 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted January 3, 2016 Report Share Posted January 3, 2016 You will work in The patch? Quote Link to comment Share on other sites More sharing options...
svott Posted January 3, 2016 Author Report Share Posted January 3, 2016 I already started. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted January 3, 2016 Report Share Posted January 3, 2016 I was make a general discussion about some commands herehttp://wildfiregames.com/forum/index.php?showtopic=16932If you are interested... Quote Link to comment Share on other sites More sharing options...
svott Posted January 4, 2016 Author Report Share Posted January 4, 2016 thx, will check it Quote Link to comment Share on other sites More sharing options...
svott Posted January 6, 2016 Author Report Share Posted January 6, 2016 Hey guys, I was thinking about the right usability of a patrol. I have not played so many different games, so I am not sure which is a nice key + mouse combination for commanding a patrol.@Initial situation: A (group of) unit(s) is selected@Possibility 1:Just a simple patrol between 2 waypoints.control: press a hotkey or a gui button and select the second waypoint with a right clickthe first waypoint would be the current positionadvantage: simple usabilitydisadvantage: very limited@Possibility 2: like 1, but you must select 2 waypoints for a patrolthus a bit more flexible@Possibility 3:Multi-point patrolI think it will be complicated to control it with a gui button because you have to uncheck it after finishing choosing patrol.But it would be easier just by using a hotkey. If the hotkey and the mouse button is pressed, the selected waypoint will be added to the queueTherefore, it is possible to create multi-waypoint patrol and also add additional points to the same patrol laterWhat do you think? Do you have any nice experience with other games? Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted January 7, 2016 Report Share Posted January 7, 2016 Is dificult answer this in technical forum, because here only the programmer talk about coding, etc. Quote Link to comment Share on other sites More sharing options...
feneur Posted January 7, 2016 Report Share Posted January 7, 2016 Is dificult answer this in technical forum, because here only the programmer talk about coding, etc.No, this is the development forum not the programming forum As for the topic itself, I would say do like most things. I.e. have a single order, but allow the player to queue more orders with the shift-key. That should work both with the keyboard shortcut and the GUI button. It might take some work on the programming side as the first order needs to be put back on the end of the queue. Quote Link to comment Share on other sites More sharing options...
svott Posted January 7, 2016 Author Report Share Posted January 7, 2016 (edited) So a patrol starts always from the current wayposition if the unit is not moving.If the unit is moving, the patrol starts at the end of the move.Both has the same implementation -> put it at the end of the queue!?EDIT: the Y key is used yet? I won't use P because it's on the other side of the keyboard And then shift+Y for queuing.But there will be no queuing by GUI button, because I don't know a good handling!? Edited January 7, 2016 by svott Quote Link to comment Share on other sites More sharing options...
svott Posted January 7, 2016 Author Report Share Posted January 7, 2016 Use case:The user sends a unit (or a group of units) to a start point p1 of a patrol.While the unit(s) is moving, the user presses the patrol hotkey (or GUI button) to order a patrol between p1 and another point p2When the unit reaches p1, it will automatically start with the patrol between p1 and p2Also, a multi-point patrol can be ordered by pressing shift additionally.______That would be in my eyes pretty useful. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted January 7, 2016 Report Share Posted January 7, 2016 Ir You ask me, age of kings is good patrol control/ command or empire Earth 2 behavior. Quote Link to comment Share on other sites More sharing options...
svott Posted January 7, 2016 Author Report Share Posted January 7, 2016 Well, and how exactly is the control? 1 Quote Link to comment Share on other sites More sharing options...
feneur Posted January 7, 2016 Report Share Posted January 7, 2016 Actually, thinking about it again, scratch what I said That doesn't make much sense. What should be done imho is to have one patrol order, but allow for queuing of waypoints during that one order (which I guess is one way to interpret what I wrote, but not if you take it literally (which would mean first patrol between a-b, then move back to b to be able to do a patrol from b-c, etc etc ) so it's better that I rewrite things =) ). 1 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted January 8, 2016 Report Share Posted January 8, 2016 Well, and how exactly is the control? the control points and the behavior, when see a enemy in their path, attack, basically is a loop of path and attack move command. But I need may be show you how work in other RTS games. Quote Link to comment Share on other sites More sharing options...
svott Posted January 10, 2016 Author Report Share Posted January 10, 2016 new implementation: // A-B-A-B-..: // if the user only commands one patrol order, the patrol will be between // last position and the defined waypoint // A-B-C-..-A-B-..: // otherwise, the patrol is only between the given patrol commands and the // last position (position of the unit at the time of the first order) is // not included // -- this is a design decision because the order queue can be extended at // any time and this makes it difficult to estimate last walk back to the // origin position Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.