neo scavenger

Creature Sprites vs. Map Position

dcfedor's picture

Hey Folks! Back on the NEO Scavenger port today. And it was a bit of a slow day, as I'm still stuck on maps.

Today's image pretty succinctly shows the problem: when the game changes resolution, creatures get offset from where they should be. The camera for the map is changing scroll values during resolution swap, and I have code to redraw the creatures based on their current tile position. However, it seems that might not be happening in the right order.

Items and Crafting Fixed, Now for the Minimap

dcfedor's picture

Hey Folks! We're getting there, after another day of tweaking rendering settings for (mainly) items.

As you can see in today's image, the Big UI mode is nearly rendering normally now. Container previews work, even with rotated items inside. Everything is scaled correctly. UI elements are mostly in place. There's still a weird green block in the top right which I haven't yet identified. Should be easy to fix, assuming I can find out what it is :)

Big UI Almost There

dcfedor's picture

Hey Folks! Another surge of progress today, as I tackled several scaling/rendering issues present in Big UI mode.

Since the mobile version never used Big UI, a lot was neglected in the port. And what's more, it's the only UI mode to mix 1x and 2x sprites, so there's a lot more complexity in getting things to display correctly. The mobile version just coincidentally avoided these issues.

Container Peek, and Map Centering

dcfedor's picture

Hey Folks! Can you guess what I did today? If you guessed "resolution stuff," congrats! You're right!

Almost half of the day was spent wrestling with a seemingly innocuous feature: container previews. When you roll over a container, it shows the stuff inside in the tooltip. Or it was supposed to.

Unfortunately, due to the way mobile differs from desktop architecture, the preview image generation requires a different code path. Particularly stacked items, which require bitmap fonts be generated and rendered wherever they are needed.

Main Menu Done, Moving On to Gameplay Mode

dcfedor's picture

Hey Folks! Making steady progress here, as the main menu is working in all 3 UI modes now. Next step: fixing in-game UIs in each mode.

There were a few more tricks to getting the main menu working in all three modes, as well as able to hot-switch between them. I had to do some special handling when getting sprites at different zoom amounts, some font face changes, window fullscreen/resize event handlers needed restoring, and a new handler for stretch mode (since the old way only worked on Flash Flixel).

Steady Progress On UI Modes

dcfedor's picture

Hey Folks! Back from vacation, and I have the scars to prove it. My body wasn't really used to the sun, heat, dust, and abuse outdoor living provides. But I suppose I look a bit more rugged for the next few weeks :)

Back in the NEO Scavenger codebase, I was able to get resolution switching to behave a bit better. I went with the ScaleMode approach, as that only required a few tweaks to get the desired results. Namely, I also had to crop the camera after adjustments to get the screen setup when switching resolutions.

Resizing Woes, and OOO Next Week

dcfedor's picture

Hey Folks! Looks like this is officially a "difficult task" now, as screen aspect ratio and resizing rears it's head.

The old NEO Scavenger had a few graphics settings that could be changed: three different UI layout/aspect ratio choices, filtering, stretching, and fullscreen. Mobile, on the other hand, just has two: widescreen and 4:3. And what's more, mobile always uses the same layout on a given device, while desktop must switch at will based on window and monitor size.

Bingo

dcfedor's picture

Hey Folks! Think I managed to get mods working today! As you can see in the screenshot, we have a few of Kaaven's test mod items loaded into the starting cryo hex. Complete with stats and images!

The issue turned out to be the way the game was setting the sprite image for items (and other assets). It was sneakily still using OpenFL's Asset system, which fails when loading files added after compile time. A quick change to the code to funnel all image requests through a function designed to try Assets and then regular file loading did the trick.

We're Getting There...

dcfedor's picture

Hey Folks! Making progress on restoring mods today.

When I started this morning, the game would crash upon trying to load Kaaven's "Mod of Doom." Usually as a result of trying to load a null, blank, or invalid ID from the mod system. I think a bug was introduced in the remapping code when it was converted from Flash to Haxe, which basically caused all IDs to remap to "0" in mods. Which, apart from not loading the correct data, also caused an index out of range error in most arrays (which assume in-game IDs of 1 or greater).

Mod Parsing Speed Bump

dcfedor's picture

Hey Folks! Made a small amount of progress restoring mod support when I hit a pretty major speed bump: images.

Early on, I did some minor rewriting of the file structure to make modding work closer to the original Flash engine. OpenFL does some weird things with files when you try to load them through its asset manager. And one of these weird things is the inability to have two of the same filename in a single AssetPaths class.