Caves, bridges

Caves, bridges

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Caves, bridges

Post 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.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Caves, bridges

Post by Peet »

MTR. Not simple in the least.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Caves, bridges

Post 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.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Caves, bridges

Post 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?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Caves, bridges

Post 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.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Caves, bridges

Post by imbaczek »

pathfinder would require major modifications (possibly a complete rewrite.) not going to happen, unless somebody steps up.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Caves, bridges

Post 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.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: Caves, bridges

Post by trepan »

Spring.MoveCtrl.SetGravity()
be wary of incompetence.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Caves, bridges

Post by Argh »

It didn't work without invoking MoveCtrl, the state, which prevents pathfinding, last time I tested.
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Caves, bridges

Post 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?)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Caves, bridges

Post 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.
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Caves, bridges

Post by thesleepless »

what would be nice is a way to add/remove available paths through lua, this could work for bridges, tunnels, railways, etc
User avatar
Falcrum
Posts: 149
Joined: 14 Nov 2007, 01:03

Re: Caves, bridges

Post by Falcrum »

User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Caves, bridges

Post by Hoi »

Does it work in spring?
User avatar
overkill
Posts: 500
Joined: 02 Sep 2006, 01:15

Re: Caves, bridges

Post by overkill »

Not iirc
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Caves, bridges

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Caves, bridges

Post by zwzsg »

Falcrum wrote:Image
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.
User avatar
Otherside
Posts: 2296
Joined: 21 Feb 2006, 14:09

Re: Caves, bridges

Post by Otherside »

woot mobile labs for CA:] good work
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Caves, bridges

Post by BaNa »

haha cool zwzsg that rocks!
Post Reply

Return to “Feature Requests”