Page 2 of 2
Re: Anti-porc measures
Posted: 12 Nov 2009, 07:00
by Gabba
Argh wrote:I'd already asked to be able to use Lua to define custom TypeMaps, and alter the pixel values, several times. I sat that one out in disgust, frankly. Having the ability to use Lua to simply write "don't go here" or "use this path ONLY" for a given Unit class would be very, very useful.
The problem is pretty darn simple: that data is currently read from the SMF. After that, it's static. There's no reason at all that it couldn't be dynamic data that could be altered on the fly, but the devs have expressed little interest. I could care less about simply changing typemaps that are already painted onto a map- that won't allow for Lua to do dynamic stuff in terms of pathing, such as denying movement through zones, slowing Units down by changing the state, encouraging certain Units to only use a certain part of the map to move on, regardless of the heightmap, etc.
At some point, I want to write a pathfinder for Spring that takes into account how many units are moving as a group, and how wide are the available corridors. But that's still far away.
In the meanwhile, I'd like to try and tackle this dynamic typemap issue. Making the data dynamic shouldn't be a problem, providing an interface all the way to the lua layer might prove more difficult, since I know very little of Spring's code. And in my experience passing data types between different languages can be hell.
I could allow you to retrieve the names and properties of existing typemaps and let you paint/read those wherever you want; or I could also allow you to ask Spring to retreive the next unused red value to dynamically create your own terrain type, and again, paint it or read it from the typemap.
Would that be enough, and does the lua interface provide you with everything you need for the dynamic pathing you were talking about?
Before you get too exited, I probably won't be done until february 2010. You know, real life stuff. But this is a medium-size project that actually seems doable (unless there's something even weirder than I expected in the Spring engine), so it's motivating.
Oh and... just thinking aloud here... does Spring have lava (damaging water) yet, or any type of terrain that can damage units?
Re: Anti-porc measures
Posted: 12 Nov 2009, 07:34
by Argh
At some point, I want to write a pathfinder for Spring that takes into account how many units are moving as a group, and how wide are the available corridors. But that's still far away.
To some extents, the heatmap does that for us.
Oh and... just thinking aloud here... does Spring have lava (damaging water) yet, or any type of terrain that can damage units?
Yes and no. Water can be defined as damaging in the map's TDF / Lua. You can also do it directly with Lua pretty easily.
Re: Anti-porc measures
Posted: 12 Nov 2009, 07:36
by Gabba
Argh wrote:At some point, I want to write a pathfinder for Spring that takes into account how many units are moving as a group, and how wide are the available corridors. But that's still far away.
To some extents, the heatmap does that for us.
Err, heatmap? Some new development that went under my radar?
Edit: mmkay, I found
this, sounds like a variation on flocking behavior. Not so great if modders need to add more custom parameters to get good behavior, though.
And how does it help with units not bunching up in a narrow passage?
Re: Anti-porc measures
Posted: 12 Nov 2009, 07:46
by Argh
how does it help with units not bunching up in a narrow passage?
The heatmap makes them not move into the area until the heat level falls enough. So, in wide areas they'll spread, and in narrow areas they tend to space better, when speeds are taken into account. It's not perfect, but it's better than it used to be.
Re: Anti-porc measures
Posted: 13 Nov 2009, 07:38
by Saktoth
I'd suggest you start a new topic about brainstorming and implementing typemap manipulation, over on the dev forum, or somewhere other than the CA forum. Theres been discussion on it so i am not sure if anyone was working on it already.
I know Google, Argh and i will all be cheering you on.
Re: Anti-porc measures
Posted: 13 Nov 2009, 21:01
by Argh
Kloot wrote a patch. I wrote some Lua to use the patch, and test how it affected the pathfinder. It isn't working perfectly yet. That's where things are atm.
Re: Anti-porc measures
Posted: 16 Nov 2009, 03:17
by smoth
smoth wrote:WTF op: jumpjets
/thread
Re: Anti-porc measures
Posted: 16 Nov 2009, 03:24
by Gabba
smoth wrote:WTF op: jumpjets
/thread
In plain english?
Re: Anti-porc measures
Posted: 16 Nov 2009, 15:58
by knorke
i think he wants players to use jumping units to jump over walls.
(but they sometimes do not quite make it and bounce back or land on topf of the wall where they are shot to pieces)