Path finding - Page 4

Path finding

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Path finding

Post by jK »

gajop wrote:Right. I was hoping I could control it dynamically since I don't need it triggering while I'm modifying the terrain, only after it's done.
1. for a map editor you normally have `fake` movedefs making pathupdate very fast
2. pause the game ;) (yes, you can still do synced changes while the game is paused)
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Path finding

Post by gajop »

Jools wrote:Since my response was disputed, I should add that I didn't test it, but I don't see why it wouldn't work.
That 'no' answer was directed to me and is correct. Your solution doesn't disable it, only makes it less frequent, which while still useful, isn't exactly what I asked. The issue is also that you can't enable/disable it while actively running Spring, but would require a restart.
Silentwings wrote:You can probably find out what is taking the time with /debug.
Hm, looks like it's mostly Lua. Achieving any greater optimization will be an interesting task...
jK wrote: 1. for a map editor you normally have `fake` movedefs making pathupdate very fast
Aye, for a number of reasons, it's turning likely that I'll also make a non-game map editor mod, without all the units. That said, I'd still allow map editing normally for stuff like Scened-BA.
jK wrote: 2. pause the game ;) (yes, you can still do synced changes while the game is paused)
:shock:
I didn't know that. I would actually disable (emp shock) all units so they wouldn't do anything while editing.
I probably shouldn't be as surprised, my original thinking was when I was still learning how to write widgets/gadgets.
It's currently not usable when paused, since I'm delaying some calls to be executed in the next GameFrame, because some callouts can't be done in the current callin (it's not possible to do some/most sync changes in gadget:RecvLuaMsg for example). However, at the time of my writing, I didn't consider delaying to Update could work just as well (admittedly I haven't tested that it really does work yet).
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Path finding

Post by Jools »

If you set it to a very high number it should in practice work the same way as disabling it. At least it seems to me it would solve the performance issues. Or why you need to disable it altogether?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Path finding

Post by gajop »

gajop wrote:The issue is also that you can't enable/disable it while actively running Spring, but would require a restart.
This means I can't disable it -> do some editing -> enable it again.

Btw, another reason why one might want to disable pathfinding altogether is because a game might not need it, although that can be done with the modrules change you suggested.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Path finding

Post by Jools »

If the scenario editor is a mod (game) then of course you can use modrules to set the parameters, you know that. I would assume that while editing missions, the path calculations are maybe not the most critical things that need to be 100% accurate and fast, especially if you mean the issue that arises when terrain changes and it needs to recalculate path. If it still is, then you can do what jk suggested and pause the simulation.

I guess I don't understand why it must be toggleable in real-time, but if it has to, you know how to make engine feature requests, which I believe is what you're saying.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Path finding

Post by smoth »

Will you stop with that crap jools.

Mod is just short for module

Maps are modules
Games are modules
Mods(in the context of the rest of the gaming world) are mutators here

Gajop's mission editor is a tool not a game
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Path finding

Post by Jools »

I used the mod word in this context because of the relationship with the modrules parameters

Can some moderator please split the stuff that's not about pathfinding to some other thread, the posts are no longer on-topic as I can see...
Post Reply

Return to “General Discussion”