Page 1 of 1
Caves, bridges
Posted: 07 Jan 2009, 20:38
by Hoi
I was just thinking that it would be epic if my rocko's were firing at someones stumpy's (which can/can't shoot back, fbi tag?) from a bridge! So a serious feature request: makes things like bridges and caves possible! I don't know if it can be done easily, but I'd certainly be win.
Re: Caves, bridges
Posted: 07 Jan 2009, 20:40
by Peet
MTR. Not simple in the least.
Re: Caves, bridges
Posted: 07 Jan 2009, 20:58
by Argh
I could do bridges, if I had Transports that could keep Units facing the direction of the Piece they're attached to. Not a fundamentally different problem than having guys walk around on rooftops.
Re: Caves, bridges
Posted: 07 Jan 2009, 21:00
by BaNa
Argh wrote:I could do bridges, if I had Transports that could keep Units facing the direction of the Piece they're attached to. Not a fundamentally different problem than having guys walk around on rooftops.
Ah, but could units pass under them?
Re: Caves, bridges
Posted: 07 Jan 2009, 21:00
by Pxtl
Argh wrote:I could do bridges, if I had Transports that could keep Units facing the direction of the Piece they're attached to. Not a fundamentally different problem than having guys walk around on rooftops.
No pathing support = no point.
Re: Caves, bridges
Posted: 07 Jan 2009, 21:15
by imbaczek
pathfinder would require major modifications (possibly a complete rewrite.) not going to happen, unless somebody steps up.
Re: Caves, bridges
Posted: 08 Jan 2009, 00:12
by Argh
Firstly, when I think "bridge", I think "non-trivial crossing"- i.e., a body of water or a deep ravine. Difficult issue, but short bridges would be fine- just move your units near enough, they'd get grabbed and would cross. Not a biggie.
However, with longer spans, it gets a lot harder, sure.
There are a couple of practical ways to go about this, imo.
If we had a 3D collision mesh or any other method to make the Unit not fall, we could have a surface they could "stand" on. Unfortunately, you can't just turn off Gravity for a Unit with MoveCtrl, so it needs to be another way.
And you need a way to turn the pathfinder OFF (hmm, I seem to have said something about this before, in another use-case context, heh) while standing in that zone, so that they can walk about. Not an impossible task, telling the pathfinder to just skip doing anything for that Unit until it leaves that zone. Straightforward Lua, you just wouldn't want to do bridges everywhere, that would get expensive. This is how it's probably done in some commercial games.
Other ones just cheat, and use a mesh that's actually a ground object in terms of collision, but looks like a bridge. Heck... I'd LOVE to see a map format that didn't actually render anything. I wonder if VoidWater works like that, if you make it all quit showing- I may have to test that out, see if it's possible to put together a kludge of some ideas I've been having.
As another way of looking at this... a bridge could use a specific, special Typemap for that area of the map, perhaps, that would declare that any land units or Hovers would prefer that zone for a crossing. Then we'd "just" need the Transport method, for it to work and be happy with the pathfinder, too.
If we could do Typemap manipulation in realtime, we could even do stuff like drawbridges.
Re: Caves, bridges
Posted: 08 Jan 2009, 03:17
by trepan
Spring.MoveCtrl.SetGravity()
be wary of incompetence.
Re: Caves, bridges
Posted: 08 Jan 2009, 04:37
by Argh
It didn't work without invoking MoveCtrl, the state, which prevents pathfinding, last time I tested.
Re: Caves, bridges
Posted: 08 Jan 2009, 05:21
by thesleepless
you could perhaps do (level) tunnels also, define an entry point into the terrain and it creates a path through the terrain until it finds an exit, something to make the units not collide with the terrain there but go through it instead (i think sometimes they used to do this by accident?)
Re: Caves, bridges
Posted: 08 Jan 2009, 11:43
by KDR_11k
Transporting a unit isn't good for pathfinding either.
Argh wrote:I could do bridges, if I had Transports that could keep Units facing the direction of the Piece they're attached to. Not a fundamentally different problem than having guys walk around on rooftops.
That is trivial with Lua.
Re: Caves, bridges
Posted: 08 Jan 2009, 15:55
by thesleepless
what would be nice is a way to add/remove available paths through lua, this could work for bridges, tunnels, railways, etc
Re: Caves, bridges
Posted: 08 Jan 2009, 18:09
by Falcrum
Re: Caves, bridges
Posted: 08 Jan 2009, 18:22
by Hoi
Does it work in spring?
Re: Caves, bridges
Posted: 09 Jan 2009, 03:32
by overkill
Not iirc
Re: Caves, bridges
Posted: 09 Jan 2009, 06:45
by Argh
I've just tested the whole gravity issue again.
Turning off Unit gravity is only possible if you invoke MoveCtrl, which in turn shuts off all non-Lua movement control.
Now, if you could turn gravity and collisions with slopes off, yet a Unit would otherwise act normally... well, then yes, it'd be... "trivial".
However, doing it with MoveCtrl is not practical the way that things currently work, imo. Too CPU-heavy, especially if you use bounds-checking and watch for collisions, and then write simplistic steering code to deal with same. That would get really expensive very fast.
Re: Caves, bridges
Posted: 10 Jan 2009, 00:50
by zwzsg
Falcrum wrote:
Hoi wrote:Does it work in spring?
Not this one because it was made before Spring, and for some ridiculous reason (not having a transportcapacity) Spring won't let it attach unit.
Here is a bridge that works better in Spring:
http://jobjol.nl/1687
As a bonus you get my mobility upgrades in which I had never fixed a silly bug (not dismissing its own ID when looking for a factory to grab) for years and that I just fixed today.
So, yeah, really outdated Cavedog 3do and stuff, probably buggy and hastily done, but at least show it can be done
(and always had been doable).
Actually that pic is a lie. But that one isn't.
Re: Caves, bridges
Posted: 10 Jan 2009, 01:19
by Otherside
woot mobile labs for CA:] good work
Re: Caves, bridges
Posted: 10 Jan 2009, 12:45
by BaNa
haha cool zwzsg that rocks!