Staredit Network

Staredit Network -> Concepts -> Detecting Velocity for 1650 units?
Report, edit, etc...Posted by fishgold on 2005-08-11 at 00:52:45
Hi, I was wondering if it is possible to detect unit's velocity(including direction and speed) through EUD triggers. And if it is possible can you briefly explain how it can be done?
Report, edit, etc...Posted by RexyRex on 2005-08-11 at 01:50:28
This is all conceptual, but you could increase a unit's acceleration speed (I'm assuming thats what you mean by velocity) with EUDs then compare it with other units then speeding it up and slowing it down accordingly. Once you do that, find an equal for all units (every unit has the same acceleration speed) and apply that speed as the global standard.
Increase the speeds gradually back to the default for each unit and find the differnce.

Eh, I'm just rambling.

Is this what you want?
Report, edit, etc...Posted by fishgold on 2005-08-18 at 06:04:52
What I have in mind is this. Comparing bits difference. (note: 1 represents unit is at current coordinate and 0 represents unit is not at current coordinate.)

If there is 128X128 map, assume that we can store whether there is unit or not in every coordinate. So if there is any unit at (0,0), (1,1), (2,2), (3,3) then system will store the information like this.


(Unit's Position)

0 0 0 0 0 0 0 0 0 0.......0
.
.
.
.
0 0 0 1 0 0 0 0 0 0........0
0 0 1 0 0 0 0 0 0 0........0
0 1 0 0 0 0 0 0 0 0........0
1 0 0 0 0 0 0 0 0 0........0


And after an interval do this again, but this time information should be stored seperately from previous one, so that we can compare each other and find out which unit has moved and how much.


(Unit's Position after an interval)

0 0 0 0 0 0 0 0 0 0.......0
.
.
.
.
0 0 1 0 1 0 0 0 0 0........0
0 0 0 0 0 0 0 0 0 0........0
1 0 0 0 0 0 0 0 0 0........0
0 1 0 0 0 0 0 0 0 0........0



But as you have noticed, this system have more than 70% of miscalculation. (or maybe more) Because there is so many possibilities that how unit could have moved. We don't actually know which unit has moved to which coordinate.

And another thing is there is absolutely no way we can store this kind of large amount of values. Even if we store only positions of 1s instead of storing every single bits.

Hm.. we can detect one unit's velocity, but we can not detect 1650 units? This could be possible only if trigger execution time becomes much less than 0.1 second.


What do you think!?
Report, edit, etc...Posted by MapUnprotector on 2005-08-19 at 11:54:26
First of all you are assuming, as you said, that you can store whether a unit is or isnt at any given coordinate:

QUOTE
If there is 128X128 map, assume that we can store whether there is unit or not in every coordinate. So if there is any unit at (0,0), (1,1), (2,2), (3,3) then system will store the information like this.


That first part would probably be very hard to accomplish and I think you would need to figure out a system for that first.

Then detecting each individual unit based on the coordinates will be even more of a problem because you must distinguish between each individual unit, as you have also pointed out.

In my experience I've tried calculating a unit's position using coordinates and storing them, and I think it would work well only for a small number of units.

At first I used Tuxedo-Templar's Zoning method:
http://www.staredit.net/index.php?showtopic=9404

And it worked pretty well, and I created a realistic bouncing ball map where a scourge would bounce off the walls on an angle calculated with it's coordinates. Here's the experimental map I uploaded to the DLDB:
http://www.staredit.net/index.php?download=3717

But one problem is that Zoning requires units being given back and forth between a player. Now you need one set of X and Y axis for every unit you want to find the coordinates of. Even with just 2 or 3 sets of these it creates a lot of lack giving units back and forth constantly.

What I tried doing was instead using locations. Now even though it requires a lot of locations, it wouldn't cause the lag that using units would cause. You would just use rows of horizontal and vertical locations to find the coordinates.

I never finished an experimental map using locations and coordinates, but I think it could work.


EDIT:

And about storing this information, maybe with EUD's for HP detection, you can set a unit's HP to store it's position on the grid, and then detect it with EUD's. I was thinking through like a unit's Shield/HP points, one to represent X and one to represent Y.
Report, edit, etc...Posted by fishgold on 2005-08-20 at 05:23:24
QUOTE(devilesk @ Aug 20 2005, 03:54 AM)

I created a realistic bouncing ball map where a  scourge would bounce off the walls on an angle calculated with it's coordinates.



Hehe, I played that map already. Very nicely designed map. It should bring revolution to mapmaking community. gj.
Report, edit, etc...Posted by iamacow on 2005-08-26 at 20:55:55
That is pretty awesome, devilesk.
The idea I made up when you mentioned a bouncing ball was like a ball bouncing around a room with velocity and gravity.
Report, edit, etc...Posted by Vibrator on 2005-08-27 at 09:32:20
For using HP to store coordinates you could just use hp/max hp just to get rid of annoying sheild regeneration.
Next Page (1)