Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

How to create an effective waypoint system for an RTS?

Archive: 3 posts


I need help. On LBP2 I am creating an RTS and I cannot make a waypoint system.
Can you tell me how to make a waypoint system with these recuriments:
- If you have told a unit to go in one direction and another in another direction, how do you make it so they don't swap or stick to one waypoint.
2011-08-02 13:43:00

Author:
POOP2002
Posts: 20


This is pretty complex, but I figure this could work: currently selected unit is notified of every waypoint click by the mouse pointer; on every click, the pointer emits a unique tag from a collection (the limit of the collection will be the limit of the system). The unit will remember these (or just know which tag to start with, end with and follow every tag in between those two) and will next execute a sequence in which it walks to the first tag that was dropped; when it reaches that tag it will proceed to the next one. While this is going on, player can select another unit and start dropping waypoints for this one, too. The pointer will continue emitting new tags and recycle available tags from the pool.

With two units or more following a path, tags will become available that are not directly following one another in sequence. So, it is better to have a unit remember each of the tags it needs to follow instead of a range; then the pointer can assign available waypoints to a unit that are picked from all across the pool instead of a range (i.e. waypoint tag #12 until #19).

Here is a recent discussion about dealing out unique ID's (https://lbpcentral.lbp-hub.com/index.php?t=59857-Giving-unique-id-s-and-signaling-channels-to-emitted-objects). Cross fingers and hope the folks from that thread spot your post; I am sure this waypoint thing is a challenge right up their alley.
2011-08-02 14:15:00

Author:
Antikris
Posts: 1340


the way i read it the op doesn't want to lay out a path, just be able to select unit 1 and make it go somewhere, then select another unit and make it go somewhere else without the 2 or more units interfering with each other

it all depends on how many units you have and whether or not you'll be able to build/acquire more units as you go along, if you have a set number and they are all different then your better off giving them each a permanent tag/follower set. however if you keep getting new ones and you often have more than one of the same unit thats when it would be best to look into having units select the next available id when it is spawned.
or on the other hand you could simply give the unit/s a new i.d each time it is selected, so if your selecting a few at once they would all acquire the same i.d as they will all be receiving the same order. that way you may only need around 10 ids for as many units as you want, and you'd be able to have 10 units/groups doing 10 different things at the same time without interfering
(10 is just an example, could use more or less depending on the level)
2011-08-02 15:21:00

Author:
evret
Posts: 612


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.