Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Strange Bug / hard to track
Strange Bug / hard to track
Jul 3 2008, 1:00 pm
By: NudeRaider  

Jul 3 2008, 1:00 pm NudeRaider Post #1

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

In a Sand Castle Wars version of mine (DARKČ v1.2 beta) you have the ability to create x5 and x10 spawns.
You can choose between regular spawning and spawns that cost 5 times (10 times) the money and spawn 5 times (10 times) as many units.

For those who don't know the map:
Spawning works by training a unit in any rax, fax, etc. Then the building goes to the comp and spawns units once about every 60s.

For the Multispawns (x5 / x10) I replace the Terran 3x4 building by a Zerg 3x2 (sometimes 2x2) building. This system usually works flawless.
But sometimes after the game is running for a while the Terran building is not removed. This only happens when you train a unit in it while the builder SCV is still 'dancing' its way out of the building it just created. With the Terran building still in place the Zerg building can't be placed resulting in an error message and significant loss of money. :flamer:

The problem is I can't reproduce this bug. It worked perfect in all my tests when I played alone.
So someone got an idea which side effect might prevent the Terran building from being removed? Note, this ONLY happens if the builder SCV is still stacked under the building, trying to 'dance' out.

Here's an example trigger: (there's one trigger for each unit that can be spawned)
Player:
Force 1
Conditions:
All Players brings at most 1500 [any unit] to Anywhere (this is to prevent spawning when near map limit)
Current Player commands at least 1 Marine
Current Player brings at least 1 Civ to 'Choose x5 Spawn'
Current Player accumulates at least 315 ore
Actions:
Center Location 'Unit Spawn' on Marine owned by Current Player at 'Anywhere'
Remove all Marine for Current Player
Center Location 'Unit Spawn' on Barracks owned by Current Player at 'Unit Spawn'
Center Location 'Move away' on Barracks owned by Current Player at 'Unit Spawn'
Move all [men] for All Players at 'Move away' to 'Temp Team 1'
Remove all Barracks for Current Player at 'Unit Spawn'
Create 1 x5 Marines at 'Unit Spawn' for Player 4 with properties (no properties applied / standard properties)
Move all [men] for All Players at 'Temp Team 1' to 'Move away'
Subtract 315 ore for Current Player
Preserve trigger

Force 1 is Human side 1
Player 4 is the Comp allied with Force 1
'x5 Marines' is the Zerg building's name
'Unit Spawn' is 1x1 blocks
'Move away' is 5x4 blocks

P.S. The SCV gets relocated. => move units actions work




Jul 3 2008, 1:07 pm candle12345 Post #2



Isn't this why SCVs are teleported to a different location in invisible bunker location the teleported back?



None.

Jul 3 2008, 1:47 pm Ahli Post #3

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

I think I know the problem because the Barracks should be removed when the location detects it.

-> The "Unit spawn" location is to small. Other Units/Buildings block the Marine (had same problems in "Kaiser").
- - - -> The "Unit spawn" is not on the Barracks because you remove all barracks in that location and the barracks still exist.

You say that it only happens when the scv dances under the barracks. -> The SCV may be the main problem here because it blocks the spawning Marine. Together with other Buildings or units it would be possible to scre your system.

Maybe you should split the detection into 2 triggers (I did the same in Kaiser), so that you can make sure that you always find a Barracks owned by "Current Player".




Jul 3 2008, 2:11 pm Clokr_ Post #4



I think Ahli got the problem. I'd suggest either making 'Unit Spawn' bigger or checking in a different trigger if there's a barracks over 'Unit Spawn'. Both methods might cause problems though.



?????

Jul 3 2008, 2:42 pm Ahli Post #5

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

splitting the trigger into 2 triggers is just there for the security (and would show us, if that is the problem).
It wouldn't cause more problems. Only if you would call a few more kb in the filesizw is a big problem...

Making the Location much bigger can cause problems. I had no problems with that in Kaiser because I made a "path" in front of every construction ground. But sandcastlewars needs the ability to build everywhere.




Jul 3 2008, 3:54 pm Clokr_ Post #6



What would you do if there's no barracks over the location? Leave the marine just there? Remove it and display a text message like "The exit of the building is blocked"?



?????

Jul 3 2008, 4:36 pm Ahli Post #7

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

and giving the minerals back :D
or you try it with a grid (which can easily fail, too)
or you try it with a bigger location then.




Jul 3 2008, 9:09 pm rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

IIRC, the remove unit doesn't run until the end of the triggers, so your marine is still there, and still being detected.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jul 3 2008, 9:26 pm Clokr_ Post #9



Quote from rockz
IIRC, the remove unit doesn't run until the end of the triggers, so your marine is still there, and still being detected.

A bring unit condition would return true but the unit is not really there anymore. So I don't think that's the problem.



?????

Jul 4 2008, 7:05 pm NudeRaider Post #10

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from candle12345
Isn't this why SCVs are teleported to a different location in invisible bunker location the teleported back?
wut?

While creating the thread It also occured to me that it might be because of 'Unit Spawn' is too small.
On the second thought there's some reasons why this is unlikely:
- 'Move away' is centered on the Barracks at 'Unit Spawn' but the SCV teleporting from 'Move away' to 'Temp Team 1' and back works
- It happens regardless of the number of units around (=> no displacement of the Marine, except maybe by the dancing SCV?)

Nevertheless I will try to confirm whether this is the problem or not. Splitting the triggers seems to be a good method to do that. I'll post again if I have a result.
Thanks for now, but I'm open to other ideas.




Jul 28 2008, 9:29 am NudeRaider Post #11

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

OK, I've split the triggers up and found out it's indeed that 'Unit Spawn' is too small. Obviously 'Move Away' was large enough to still encompass the SCV even if it was justs centered on the marine.
Just making it bigger brings another problem though. If the marine is NOT displaced it will be created on the very left edge of the barracks and the bigger location will center on the barracks just left of it (if there is one), instead on the barracks I created a marine in.

So is there another way to fix the displacemant of the marine automatically? I can detect if there's no barracks and cancel the spawn and give the money back, but that looks unprofessional.




Jul 28 2008, 3:28 pm Ahli Post #12

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

just try to make it a little bit bigger.
I think you need to mark the area where the unit was displaced with another location to see where the unit was placed (center on rine before removing, always create and kill a special air unit). Then you can try to modify the spawn location perfectly...




Jul 28 2008, 4:23 pm NudeRaider Post #13

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

I already tried 40x40 px instead of the normal 32x32 px. It does not fix it.
Anything larger than 40x40 px seems to fix it but I have the problem of sometimes getting the wrong barracks.

I was looking for an alternative to changing the location size.

Actually I just had an idea. As the problem seems to be caused by the dancing SCV I could center a 1x1 px location on the SCV and when the player brings a barracks to this location I move the SCV to the same location which should teleport the SCV adjacent to the barracks.

I don't perfectly like that idea because dancing SCV under barracks happens quite often and the teleport just doesn't look nice.
Also you would have no control about where the SCV exits the barracks - it would probably always be placed south of it which in some circumstances could be huge disadvantage. If it wasn't teleported you still would have limited control and might get lucky it responds to spam clicking.

So as this also isn't perfect I'm still open to suggestions.




Jul 28 2008, 7:58 pm Ahli Post #14

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

I fear that the mistake in your location size change was that you increased the range of the x coordinate.
(I think that your mistake is that the barracks on the left side was selected.) maybe just increasing the y value and not the x value can fix it. But I can only be sure or think of the best solution if you could make a pic where the displacement happened (with marking the position) because I need to know where the marine actually spawned, if we try to fix it with the location itself.

maybe you just need to increase the build time ;P




Jul 28 2008, 9:07 pm Zombiechao Post #15



Doesn't the creep from the zerg building cause problems?



None.

Jul 29 2008, 1:44 pm NudeRaider Post #16

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Zombiechao
Doesn't the creep from the zerg building cause problems?
I remove T buildings and create Z in place of it. T don't have creep that might get in the way. Also I've never heard creep would stop a Z building from being constructed.
And before you ask, no I don't place hatcheries, creep colonies and such which would generate a radius of creep.

Quote from Ahli
maybe you just need to increase the build time ;P
If you know Sand Castle Wars you'd know thats a no go. Doesn't suit the map.

Quote from Ahli
I fear that the mistake in your location size change was that you increased the range of the x coordinate.
(I think that your mistake is that the barracks on the left side was selected.) maybe just increasing the y value and not the x value can fix it. But I can only be sure or think of the best solution if you could make a pic where the displacement happened (with marking the position) because I need to know where the marine actually spawned, if we try to fix it with the location itself.
That actually sounds pretty good. It will at least minimize the selection of the wrong building. Duh, simplest solutions are always the best, aren't they? ;)
I did that and now I'm doing a couple of test games to see how it will work out.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
Please log in to shout.


Members Online: Roy