Home ⁄ Strategy Games ⁄ Empire Deluxe CE ⁄ Working with EDCE Roads is Painful

Working with EDCE Roads is Painful

For the sake of completeness, I’ve decided to do road networks next.  I knew this was going to be a painful exercise before I got started.  But for the sake of completeness, I wanted to finish out the map-related art in the terrain directory before I moved on to something else more interesting, probably unit tiles.

I assure you, the roads in the screenshot actually DO connect properly with no graphic glitches, when I am wire-framing them.  The issue is the way the game renders them and their multiple overlapping alpha channels.  I actually uncovered the problem with alpha channels when I was working on the supply icons.

I don’t know if its the method used by the developer or the Unity engine in general (my gut tells me it’s the combo of both) the engine seems to use the compatibility method of working with PNG files with an alpha channel.  I’ll post a more in-depth post about this, and how I got around it, but essentially because Unity is forced to accept indexed and non-indexed PNG files with alpha channels. It means the engine causes some interesting bugs by “guessing” when the alpha channel should be applied and when it shouldn’t.  I got around this problem with the static sprites in the misc tiles set by setting the alpha pixels to the default color.  But the problem with roads is the way they are generated requires overlaps, meaning I can’t set a default alpha channel without glitches appearing in game.

This issue is actually present in the default tile set in EDCE.  To see the problem in all it’s glory, build a road network in Empire Deluxe CE and zoom in close.  You will notice on the default road images the yellow lines are not all the same length.  This is because the game is generating the road sprites dynamically and merging them together.  I do like this approach because it is breaks the monotony, but it creates a brutal problem when alpha channels are not only 0% or 100%.  I can see Mark’s conundrum when he chose to do the roads this way, and is visible in my attempt as well as the diamonds in the screenshot I provided.

I’m torn on how much time I should spend on this.  My gut says if I did a poll, or asked the developer to provide some data, I’ll find out that roads are probably never built in game, or seldom considered important if they are built.  This is due to a flaw in the game rules that make roads are almost completely useless unless trying to go through blocked terrain like peaks.  That means I’m probably just wasting time if I spend the next few weeks trying to get it right because few people will see it in-game.  So there is a good chance I may just “give up” and post an incomplete file just so I can move on.

I mean, on higher, more common zoom levels, the problem is not visible.  It’s only on the lower three or four zoom levels where this really looks bad.

Leave a Reply

Your email address will not be published. Required fields are marked *