Maps of different shapes.
Moderator: Moderators
Re: Maps of different shapes.
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?
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Maps of different shapes.
reminds me of those extremely annoying boundaries in the battlefield series that killed you before you knew you were out of bonds while flying
- thesleepless
- Posts: 417
- Joined: 24 Oct 2007, 04:49
Re: Maps of different shapes.
use lua to check for units outside the boundary, if they are, tell them to move back to the closest edge?
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Maps of different shapes.
for this post: lava = Water with damage
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.
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.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?
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.
Re: Maps of different shapes.
WHO SAID LAVA. I we are talking about defined map shapes. I said NOT lava.
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Maps of different shapes.
I said lava, as a short version to "water that does damage".smoth wrote:WHO SAID LAVA. I we are talking about defined map shapes. I said NOT lava.
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.
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: Maps of different shapes.
Missing the point.Beherith wrote:ETA? Any details?Auswaschbar wrote:in before new map format.
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.
Re: Maps of different shapes.
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?jK wrote:you can prohibit all those with gadgetssmoth 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.
Re: Maps of different shapes.
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.
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.
Re: Maps of different shapes.
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 ...
you don't need anything else than AllowCommand, and perhaps a check if some units fall in the prohibited area every 2-5secs ...
Re: Maps of different shapes.
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.
And not every Unit movement is due to AllowCommand.
That said, yes, that's the easy way to prevent certain things, like transport dropoff.
Re: Maps of different shapes.
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
-> movement is limited via typemaps
and a check every 2-5sec is more than enough trust me
Re: Maps of different shapes.
Not if you're trying to implement a circular map, imo.who said to use AllowCommand to prevent movements? (planes etc. should still be able to fly over such areas ...)
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
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: Maps of different shapes.
Re: update frequency:
EDIT: More succinctly: http://trac.caspring.org/ticket/1217 regarding Google Frog's script.
EDIT: More succinctly: http://trac.caspring.org/ticket/1217 regarding Google Frog's script.
Re: Maps of different shapes.
QFTCarRepairer 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.
What shape will you need?smoth wrote:this stuff has a use in my own work so i am asking because I will need to write it some day.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Maps of different shapes.
Just use typemaps and allow command. Units can already fly outside the map whether they're aircraft or thrown there.
Re: Maps of different shapes.
towerdefense ones.zwzsg wrote:What shape will you need?smoth wrote:this stuff has a use in my own work so i am asking because I will need to write it some day.
Re: Maps of different shapes.
I'd like to play on the surface of a 3d object
Re: Maps of different shapes.
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.
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.
Re: Maps of different shapes.
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.
Would also be good for making prettier maps, because you could include terrain outside of the playable area.