Custom Map #199: Islands Jumping Fog of War. By: Pawel345

Started by AutoPost, February 05, 2014, 05:35:50 PM

Previous topic - Next topic

AutoPost

This topic is for discussion of map #199: Islands Jumping Fog of War


Author: Pawel345
Size: 193x193

Desc:
I would like to have some opinins about the Fog of War script so I added it to this map. Hope it's fun. #CRPL #DMD #Void #Spores #noDigitalis

12345ieee

#1
First of all I really liked the effect, it reminds me of old days playing AoE2.

However I found two strange things:
1) Whenever you drop a CN the top left squares light up, as if while the CN is in air it is counted to be in the top left, I don't know if this is intented to let me see the huge aether pack, but it quite ruins the point of the effect.
2) At various degrees of zoom the lines that divide the squares mess up in various ways, they even seems disallineated in the picture below.

I would also have preferred that you didn't put the uncovered map in the CS thumbnail, because looking at it kinda ruins the effect, too.

See the image in spoiler for a screenshot:
Spoiler
[close]

P.S.: Is there a way to get a screenshot of what I'm seeing without the HUD? I remember it was possible, but I cannot remember the hotkey.

EDIT:
After a full playthrough I have a few more remarks:
- After reloading my save I got a huge performance slowdown, even though my network was big I never saw such a slow performance in CRPL-free maps, so I think some of your scripts does not like reloading.
- As far as I could tell having units in PZs didn't affect their range of vision, it would be cool if it did.

pawel345

The first effect I don't know how to fix, it might be something with how the CN are handled.
The lines likewise, the images are all black so I'm not sure why are displaying like that.
About the PZ maybe, but that would be quite complicated. As currently the script works in a way, that there are a lot of cores and they all check if there are units nearby. If yes change to transparent if not to black.

I don't know if the performance change is because of my script, as the creation of cores is in a :awaken function, but the core than selfdestructs, so it shouldn't happen again.

Clean0nion

Take a full map-only screenshot by pressing F11. It's saved to docs/cw3/screenshots.

The white outline indicates that the images are something like Custom0 or Custom0_256. They need to be Custom0pp or Custom0_256pp for the outline to not show.

pawel345

Ah thanks :D In the next map it will be :D hmm Wonder what will happen if I make one of my space islands maps with this script :D

knucracker

I took a quick look at the scripts.  A few notes follow.  Note that I really like the effect and enjoy this map.... so take what I say below in light of professional development type advice on how to make the scripts better :)

- You want to use the "pp" custom images.  That stands for PixelPerfect.  When you use the other images, the edges of things get anti aliased. That's why you see gray lines at the edge of each square.

- The :Awake function gets called each time the core is constructed... so this also happens each game load.  So each game load a new set of FOW cores are being created.  If you only want something to happen once the you can check the updatecount in :Awake and make sure it is 0.  That will only happen at the very start of a game and the update count will be greater than 0 every frame afterwards.

- Each core is constantly checking for units in range and calling setImageColor.  A performance gain could be had by toggling a state so that you don't call SetImageColor for every core every frame.

- Since each core has to get the unitcount that is in a range, this map is going to be intrinsically expensive to update.  The more units are on the map, the more computation will occur.  GetUnitCount is an O(n) operation where n is the number of units on the map.  So 'smaller' maps are better with this technique since that limits the number of cells.  If a map had large void areas, FOW cells could also be left absent from purely void areas.

Clean0nion

This seems to be one of two(?) CW3 Impossible challenges.
1. FoW
2. Crazonium

Helper

Very fun game to play.
"Fog of War" is absolutely apt.
Thanks,
H

pawel345

Quote from: virgilw on February 06, 2014, 01:29:04 PM
I took a quick look at the scripts.  A few notes follow.  Note that I really like the effect and enjoy this map.... so take what I say below in light of professional development type advice on how to make the scripts better :)

- You want to use the "pp" custom images.  That stands for PixelPerfect.  When you use the other images, the edges of things get anti aliased. That's why you see gray lines at the edge of each square.

- The :Awake function gets called each time the core is constructed... so this also happens each game load.  So each game load a new set of FOW cores are being created.  If you only want something to happen once the you can check the updatecount in :Awake and make sure it is 0.  That will only happen at the very start of a game and the update count will be greater than 0 every frame afterwards.

- Each core is constantly checking for units in range and calling setImageColor.  A performance gain could be had by toggling a state so that you don't call SetImageColor for every core every frame.
I managed to fix these, and the cores don't call that every frame, I make only 1/15 of the cores to work in one frame so that there will be less lag. Also changed so that cores that are on void selfdestruct.

Quote from: virgilw on February 06, 2014, 01:29:04 PM
- Since each core has to get the unitcount that is in a range, this map is going to be intrinsically expensive to update.  The more units are on the map, the more computation will occur.  GetUnitCount is an O(n) operation where n is the number of units on the map.  So 'smaller' maps are better with this technique since that limits the number of cells.  If a map had large void areas, FOW cells could also be left absent from purely void areas.

What function should I use then? I though this one was the best suited for the task. The only information that matters is whether there is any unit or not.
Also how are the CN's that are landing handled? Since when you land a CN my script detects it as coords 0,0

eduran

I have a FoW script lying around that I never used. To get reasonable performance on big maps with lots of units I did two things:
1) The entire FoW is managed by a single core. All images are attached to that core.
2) I do only one GetUnitsInRange call across the entire map. The units found mark fog squares around them as transparent. Once that is done, they are added to a list of already processed units and are ignored until they move or die.

I'll post the script when I am back at home.

planetfall

One thing of note is that landed remote guppies don't clear the FoW, which is annoying since you can't see where the creeper is to build a collector to actually see where the creeper is... I don't think there's a way around this other than using GetUnitAt a bazillion times and making it even laggier.

The inability to see where other islands are also makes it very annoying and I have to shoot in the dark to move my units there without looking at the map preview, which feels a little like cheating. The build% on the spore towers helps to know where the islands are but doesn't help to find a safe landing spot on them. I think FoW is more suited to a "full planet" map, or at least one where the void is either crossable by network connections, or has nothing on the other side.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Jamz

Quote from: planetfall on February 07, 2014, 11:51:53 AM
One thing of note is that landed remote guppies don't clear the FoW, which is annoying since you can't see where the creeper is to build a collector to actually see where the creeper is... I don't think there's a way around this other than using GetUnitAt a bazillion times and making it even laggier.

The inability to see where other islands are also makes it very annoying and I have to shoot in the dark to move my units there without looking at the map preview, which feels a little like cheating. The build% on the spore towers helps to know where the islands are but doesn't help to find a safe landing spot on them. I think FoW is more suited to a "full planet" map, or at least one where the void is either crossable by network connections, or has nothing on the other side.

I think planetfall has pretty much hit the nail on the head here.
I also enjoyed the map and liked the Fog of War but when it came to the point that I needed to start jumping islands, then it became a bit annoying and felt like I had to play quite a bit of a guessing game to a) find out where there was land for me to place units on and b) where there was little creeper so that I could move weapons to make a safe reliable zone.
Now granted, the terrain and creeper info displayed at the bottom panel helped a bit but still, I had to spend a good amount of time pausing the game and blindly moving my mouse around the entire map to find terrain and creeper info from the bottom panel.

Like planetfall said, I think the problem with implementing Fog of War in this particular map was because of the map being split in islands and not as one big continuous planet.


pawel345

Well that's why there was the dialogue at the beginning to tell you where to look for a map of this map :D So it was intended to have a minimap :D
Also I just made a "Radar" for the player to fire at a chosen location that will reveal the terrain for a while :D  So on the next map using this script, while there might be some void again, it will make things more player friendly.

Relli

Quote from: pawel345 on February 07, 2014, 05:54:32 PM
Well that's why there was the dialogue at the beginning to tell you where to look for a map of this map :D So it was intended to have a minimap :D
Also I just made a "Radar" for the player to fire at a chosen location that will reveal the terrain for a while :D  So on the next map using this script, while there might be some void again, it will make things more player friendly.
You launch it out to a spot and it lights up the darkness for a limited time? If it were me, that would totally be called a Flare. It fits beautifully.

Helper

Quote from: Relli on February 08, 2014, 09:10:40 AM
You launch it out to a spot and it lights up the darkness for a limited time? If it were me, that would totally be called a Flare. It fits beautifully.

That would be on the far side of amazing! Launch a "Flare Ship" in the direction you want to explore and turn it loose. Looking forward to seeing that.