Twitter  Facebook  Google+  YouTube  E-Mail  RSS
The One Man MMO Project
The story of a lone developer's quest to build an online world :: MMO programming, design, and industry commentary
Normal Maps, Pathing and Bugs, Oh My!
By Robert Basler on 2015-03-02 09:44:27
Homepage: onemanmmo.com email:one at onemanmmo dot com

I haven't had anything new and exciting to blog about lately because mainly I've been fixing and finishing things since the middle of January. Some people like to be fancy and call it "technical debt," I just call it "finishing stuff."

The%20Imperial%20Realm%20-%20Miranda%20-%20Long%20Distance%20Debugging_Lo.jpg

It is amazing how much time can go into fixing seemingly minor issues. There are a number of screen transitions during the login and base layout progress right up until you are in-game and playing. They're animated and as whizzy as I can make them and they all work, but a couple of them have minor rendering issues. I think its really important that the player not see any bugs in the first couple minutes of play so I've been trying hard to find and fix everything in that section. A couple of those have proven to be particulary pernicious bugs that I have fixed repeatedly, only to discover a day later that they're broken in a new and interesting way. I'm down to two bugs there now so it is looking pretty smooth.

The main thing I've been working on is finishing unit movement. The system is big and complicated with a lot of moving parts, and I've been methodically going through it and finishing all the corner cases and TODO's where it previously would just give up, maybe ASSERT, sometimes desync everybody. I was a little sad when I had to put in unit teleportation to fix one particularly pathological fail case, but it is something that players should see only rarely and hopefully I can work out a better solution at some point.

In addition to fixing corner cases and debugging, I have also been completely reworking the unit driving AI. I didn't really add anything new, I mainly just rearranged all the things I already had into a whole that works much better than the old system. Units will almost never get stuck now and movement is much more realistic. I'm still polishing that up, hopefully I can wrap that up this week.

There have been some new things. There's now a handy ping meter on the in-game menu. Ctrl-V now works to paste into the UI. I started work on a super-simple web-based bug database.

Long Distance Pathfinder Debug Display

I'm super excited that I finally was able to add a feature that I've wanted to have for a couple of years but just couldn't justify the day of development time it took.

That blue line shows the path generated by Miranda's long distance pathfinder. The path is fed to peers one segment at a time as-needed. Knowing that that happens is one thing. Seeing the path transferred to peers live, one segment at a time, on the screen in front of you, is a completely different experience. The red marker is the unit's current destination. The red square above the unit lets me know which unit has which target. When there are multiple units moving there are a number of different colors. The purple and blue blotches on the terrain mark objects as they're seen by the grid collision system.

Very occasionally I get buggy paths from the pathfinder, so I'm hoping this will let me track that problem down.

Converting Bump Maps to Normal Maps

I had a big discovery this weekend while I was working to import the amazing Fractal Flora pack I bought into the game. Fractal Flora comes (mostly) with grayscale bumpmaps instead of normal maps. Miranda uses normal maps, so I needed to find a way to convert them. Since the Fractal Flora pack is designed for Unity, I figured I better find out how they do the conversion. This led me to this code example which I was able to adapt to make normal maps Miranda could use.

From what I read, grayscale bump maps have white as high points and black as low points but looking at the normal maps, everywhere there should be a bump, there appeared to be a dip. I did a quick search for normal map on Google and realized that on the normal maps there, where there is a bump, it appears there is a bump. So I opened up Gimp and tried its normalmap plugin and with the default settings, it converted bumps on the grayscale map to dips on the normal map! All the normal maps I had created for my terrain were wrong.

I then spent a few minutes playing with the normalmap plugin and discovered that I needed to make sure Wrap was checked so normalmaps would wrap at the tiled edges, and Invert Y so they would bump not dip. I ran all my terrain normal maps through with the new settings, and it is a noticeable improvement. Some of the black rocky areas are looking amazing now. Below are the old and new normal maps for cliff-faces which feature lots of cracks.

cliffsnormalmap.png
[Wrong!]

cliffsnormalmap%20-%20new.png
[Right]

After I played with GIMP, I realized it could do the same conversion that the program I borrowed from the Unity camp does. The normal maps end up very similar, the Unity ones have a little more relief than the ones from GIMP. In an attempt to be truer to the artistic intention, I've decided to do the Fractal Flora bump map conversion with the Unity-inspired tool.

New Comment

Cookie Warning

We were unable to retrieve our session cookie from your web browser. If pressing F5 once to reload this page does not get rid of this message, please read this to learn more.

You will not be able to post until you resolve this problem.

Comment (You can use HTML, but please double-check web link URLs and HTML tags!)
Your Name
Homepage (optional, don't include http://)
Email (optional, but automatically spam protected so please do)
Connery or Craig? (What's this?)

  Admin Log In



[The Imperial Realm :: Miranda] [Blog] [Gallery] [About]
Terms Of Use & Privacy Policy