Maps of different shapes. - Page 2

Maps of different shapes.

Requests for features in the spring code.

Moderator: Moderators

User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Maps of different shapes.

Post by smoth »

so you are saying in the heat of battle because the implementation is screwy, when that odd player unit wanders/shoved/falls into the bad zone I should kill it thus penalizing the player for a flaw in the implementation?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Maps of different shapes.

Post by bobthedinosaur »

reminds me of those extremely annoying boundaries in the battlefield series that killed you before you knew you were out of bonds while flying
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Maps of different shapes.

Post by thesleepless »

use lua to check for units outside the boundary, if they are, tell them to move back to the closest edge?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Maps of different shapes.

Post by SirMaverick »

for this post: lava = Water with damage
smoth wrote:so you are saying in the heat of battle because the implementation is screwy, when that odd player unit wanders/shoved/falls into the bad zone I should kill it thus penalizing the player for a flaw in the implementation?
Why are game physics now a flaw? When a unit gets thrown into lava - well that's the game. (CA has units that do that.) I don't see the penalization there.

Again, you as map maker, you can decide what to you. You don't have to kill it. You can give it the command to move out (or as suggested for already approaching units) or whatever.

To pushing: well, would you gather units near lava with the possibility that some get pushed into the lava? At some point it's the responsibility of the player.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Maps of different shapes.

Post by smoth »

WHO SAID LAVA. I we are talking about defined map shapes. I said NOT lava.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Maps of different shapes.

Post by SirMaverick »

smoth wrote:WHO SAID LAVA. I we are talking about defined map shapes. I said NOT lava.
I said lava, as a short version to "water that does damage".

Your argument were game physics etc., that units get somewhere where the player does not want them (or the map maker intends units not to be there). Happens in with water that does damage and with map shapes (map areas you define as forbidden territory).

With water that does damage the solution is: the unit gets killed after some time. Map shapes etc. with the current engine: you can emulate the same solution or do something else as suggested.
Last edited by SirMaverick on 12 Jun 2009, 22:10, edited 1 time in total.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Maps of different shapes.

Post by Evil4Zerggin »

Beherith wrote:
Auswaschbar wrote:in before new map format.
ETA? Any details?
Missing the point.

Frankly the idea of a limited map at all is pretty artificial (but necessary). If you want to limit the map size, use typemaps + force/teleportation field gadget (e.g. see Google Frog's anti-fac-intrusion script for CA) + display widget (maps can have widgets, right?)
Last edited by Evil4Zerggin on 12 Jun 2009, 22:10, edited 1 time in total.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Maps of different shapes.

Post by Neddie »

jK wrote:
smoth wrote:funny how units can get pushed into those typemaps aicraft can land there and I wonder, but suspect transports can drop units off there.
you can prohibit all those with gadgets
You don't even need to. Some very old maps would merely have deployed units teleport back to pick up point... that one really metal starved one with four/five mexes on either side of a winding passage through stone peaks... The Pass?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Maps of different shapes.

Post by Argh »

It's actually not too hard to do travel limitations that would effectively allow for variant map shapes. There are a couple of valid solutions available:

1. Use something like World Builder, and put down "buildings" that take up space, are invisible, have a Footprint, and automatically kill / teleport / whatever objects that are near / on / over them every half-second or so.

Easy stuff. Only hard part is coding a "safe place" finder for teleport. Not that hard though. Probably the easiest method is to do it like I do the buildings in P.U.R.E.- just teleport them to a Piece position.

That would take care of everything from aircraft to units getting pushed or whatever. Really not that big of a deal. Making it non visually jarring would be a minor challenge.

2. Do it the hard way. Use Lua to map the forbidden zone by reading the typemap, and use the resulting pixel boundaries to construct a collision mesh. Then check the mesh or meshes every frame for collisions along their planes (that's a hint, btw). If a collision is detected, Movectrl the Unit and drop it in the nearest valid heightmap square.

This would be CPU expensive, but may or may not be cheaper than using Units to do the same thing. And it would deal with aircraft.

There are probably other ways to implement this, but really this isn't a very hard problem. There are lots of articles available on collision detection strategies. Doing a circle is easy, with this method. or various other ones (like get the distance from the center of the map to the Unit, and if > max radius - unit radius, then Movectrl stop, the end (kinda expensive to do it every frame tho, there are probably ways to make it cheaper).



Lastly... I just thought of a simple way to do "endless maps". Make a Unit that is invisible and will check the area of its Footprint every few frames, and will teleport Units that cross that boundary to the other side of the map, +/- whatever offset is necessary to avoid endless teleportation.

Should be very easy Lua to make that code, and idiot-simple to implement it. Only problem is that on huge maps, the performance costs are going to be rather large. I have no use for that concept atm, so have fun with the solution.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Maps of different shapes.

Post by jK »

o_O

you don't need anything else than AllowCommand, and perhaps a check if some units fall in the prohibited area every 2-5secs ...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Maps of different shapes.

Post by Argh »

Not if you're going to make it really clean. 2-5 seconds means that things that are propelled go well outside the boundary before a check occurs.

And not every Unit movement is due to AllowCommand.

That said, yes, that's the easy way to prevent certain things, like transport dropoff.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Maps of different shapes.

Post by jK »

who said to use AllowCommand to prevent movements? (planes etc. should still be able to fly over such areas ...)
-> movement is limited via typemaps
and a check every 2-5sec is more than enough trust me
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Maps of different shapes.

Post by Argh »

who said to use AllowCommand to prevent movements? (planes etc. should still be able to fly over such areas ...)
Not if you're trying to implement a circular map, imo.

And AllowCommand doesn't cover pushing or Units that have been pushed into the air by explosions. I haven't tested, but I'm not even sure that a "stop" command is issued to aircraft when they land because they're out of targets and don't have further orders. I'll have to look at that sometime, it's probably yes and that means that fixing that retarded behavior is an easy Gadget.

As for 2-5 seconds... it really depends on the game. There are few things more jarring and off-putting than a "solid" "non-game" area getting crossed by a Unit, though. It's very unprofessional-looking and really ruins the illusion
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Maps of different shapes.

Post by Evil4Zerggin »

Re: update frequency:

EDIT: More succinctly: http://trac.caspring.org/ticket/1217 regarding Google Frog's script.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Maps of different shapes.

Post by zwzsg »

CarRepairer wrote:You'll have to call the jpg or png folks and ask them to create a new shape for image formats too, instead of those tired old rectangles.
QFT
smoth wrote:this stuff has a use in my own work so i am asking because I will need to write it some day.
What shape will you need?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Maps of different shapes.

Post by Google_Frog »

Just use typemaps and allow command. Units can already fly outside the map whether they're aircraft or thrown there.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Maps of different shapes.

Post by smoth »

zwzsg wrote:
smoth wrote:this stuff has a use in my own work so i am asking because I will need to write it some day.
What shape will you need?
towerdefense ones.
YokoZar
Posts: 883
Joined: 15 Jul 2007, 22:02

Re: Maps of different shapes.

Post by YokoZar »

I'd like to play on the surface of a 3d object
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Maps of different shapes.

Post by Jazcash »

I think boundries would be a good idea. For example, a mapper makes a square map, and can then draw any shape he wants inside that square to be the actual playable part of the map.

Ingame, all parts outside of those boundries push units back into the playable part of the map and no commands can be issued outside of that playable area.

Although, we'd need a team of highly trained monkeys to achieve this.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Maps of different shapes.

Post by Pxtl »

Just use 2 layers for the boundaries. The inner layer is "no units can receive orders outside of this layer". The outer layer is "bad shiat happens when you go outside of this layer". That way, if aircraft fly outside of the map, or ground units wander outside of the map in the course of their normal movement, nothing crazy happens unless they hit the outer layer. Then you can do the "kill the unit" or "override orders" or whatever.

Would also be good for making prettier maps, because you could include terrain outside of the playable area.
Post Reply

Return to “Feature Requests”