Yet another OHRRPGCE dev blog

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Okay, I love those clouds, and I want them in the game when the feature is ready. :D
ArtimusBena
Slime Knight
Posts: 251
Joined: Thu Nov 16, 2017 5:22 am

Post by ArtimusBena »

Alpha transparency is a huuuuge advancement! Glad you're working on it :)
User avatar
FyreWulff
Slime Knight
Posts: 107
Joined: Wed Mar 13, 2013 9:16 pm
Location: The Internet
Contact:

Post by FyreWulff »

Alpha transparency is definitely one of the big things the engine needs
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Updates not often enough.

I've been focusing on bugs. But not just release-blocker bugs. Umm. People using nightlies don't realise how buggy nightlies are, because they don't bump into of most of the bugs -- that's my excuse. Still at 25 reported unfixed bugs new in nightlies, mostly minor or in new features. But we also fixed 67 etheldreme bugs, so overall I think it's much less buggy!

Also spent a lot time on crash report processing and better reports.
I think I discovered the cause of the infamous MIDI loop crash bug that has plagued us for 14 years (it's a bug in SDL_mixer) and how to fix it. A large fraction of crash reports are caused by it.

Since my last post James and I:
-made 122 SVN commits
-fixed 10 reported bugs in nightlies
-fixed 7 reported bugs in etheldreme

New features:
-James added "Shrink to Center" dissolve animation
-"Useable in battle from spell lists" attack bit
-Added "last menu item", "menu item count", "visible menu item count" commands
-"get npc/hero sprite", wrappers around "get npc/hero slice"
-"suspend text box controls" is now a separate command, not an alias for "suspend box advance"
-Got gfx_sdl2 working on Mac, but no night build yet. This will become the default backend in future (on Linux and Windows too)
-You can import .wav as music (converts to .ogg). People complained.
-Buy menu shows amount of trade-in items you have, and prices can be formatted like $10 instead of 10 $ (two new global text strings)

In total since etheldreme:
-1438 SVN commits
-67 newly reported bugs in etheldreme fixed
-42 of 67 reported new-in-nightlies bugs fixed
Last edited by TMC on Tue Sep 03, 2019 11:55 am, edited 4 times in total.
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

Great work! The OHR is like a medieval castle, that got it's wall freshly repaired.
TMC wrote:Also spent a lot time on crash report processing and better reports.
I think I discovered the cause of the infamous MIDI loop crash bug that has plagued us for 14 years (it's a bug in SDL_mixer) and how to fix it. A large fraction of crash reports are caused by it.
Can you elaborate a little more about this MIDI crash? Unfortuneatly the fantastic MIDI songs had the disadvantage of sounding different on other computers, but also behaving differently on different computers! Are there any patterns in a song that causes a computer to fail?
Once, a one-note MIDI file (used as a sound effect) brought all Windows computers newer than Windows 98 to a halt. With the same game.exe and .rpg file.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Even well-maintained castles are obsolete...

The crash has a chance to happen whenever a MIDI file loops, so shorter sounds, especially those used as sound effects, are more likely to cause a crash. Also it seems more like to occur when something else interrupts the program at the same time, like minimising the window or attaching a debugger.
Also, separately, if a MIDI file contains no waits at all then it will loop immediately, consuming 100% CPU and causing the program to freeze for several seconds at a time.
It doesn't happen on Win 98? Are you talking about freezing or crashing?
Last edited by TMC on Wed Sep 04, 2019 8:55 am, edited 4 times in total.
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

As castles are obsolete, they still can be beautiful!

On Windows 98 the game didn't crash when this "bad" MIDI file was played, instead it was slowed down terribly. Left the map, another song was played, everything went back to normal. On a Windows 7 and a Windows 10 system, the game crashed at that point, when the bad MIDI was played.
I remember that it was a MIDI file that was meant to represent silence, so it only consisted out of pauses (no notes). After realising the impact it had on game.exe, a song with one note and a lot of pauses and a MIDI track volume at 0 did the same, without crashing.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Strange that a MIDI containing a wait also slows down the program!
Even if I fix the crash, I think I might need to make a separate fix to stop the freezing on waitless/very short MIDIs, like enforcing a minimum delay before looping.
Last edited by TMC on Thu Sep 05, 2019 12:37 am, edited 1 time in total.
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

A lot of sound programs don't recognise the blank pauses after the last note of a MIDI file, which I think, the OHRRPGCE does too. The pauses are simply dropped. That can be avoided by placing a muted note behind everything, because notes aren't dropped.

That could also depend on the MIDI program, with which the MIDIs are created.

We have to be careful wih a delay, because for long MIDIs, that are meant to be a looped soundtrack for example, a delay behind the song would destroy the tact. But for let's say MIDIs shorter than 8 seconds it would be practicable. Or for MIDIs with a filesize of less than 1 KB.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Ah, that makes sense.
I would probably only be adding an extra pause to MIDI tracks less than 0.5s long, or something like that.
I've noticed that some MIDI players like Timidity and ADLMIDI loop an extremely short MIDI after several seconds instead of immediately
Last edited by TMC on Thu Sep 05, 2019 1:27 pm, edited 1 time in total.
ArtimusBena
Slime Knight
Posts: 251
Joined: Thu Nov 16, 2017 5:22 am

Post by ArtimusBena »

.5s is a very long time
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Really bad at blogging.

We're definitely in the final bugfixing stretch for Fufluns. Fixed a lot of bugs yesterday (still no blockers...). I'll attempt daily updates : o

Since my last post James and I:
-made 109 SVN commits
-fixed 3 reported bugs in nightlies
-fixed 9 reported bugs in Etheldreme

Let's see... (stuff James did not included; he's been active too)...

I implemented stencil slices, which create non-rectangular clip areas. Any slice can be marked as a stencil slice, including map layers.

Image

However, I decided to leave them out of Fufluns because I haven't finalised how to allow stencil masks defined by a collection of slices, rather of a single slice. More later.

I noticed that creating sprite slices was suspiciously slow, and ended up (after fixing a FreeBASIC bug that broke runtime profiling) rewriting the palette cache. That sped up sprite creation 6x. Then I decided to leave that out of Fufluns too, to be on the safe side.

Did a lot of investigations and started working on storing 8, 24 and 32-bit graphics in compressed format, for after Fufluns.

Importing scripts on Windows failed if hspeak showed a warning. That was a bug that's been around over 8 years. But no one ever complained :zombie: Warnings aren't errors, you know!

Heroes/NPCs no longer misalign if you change their speed mid-step or if the speed doesn't divide into 20. I didn't fix it 10 years ago because I had the idea (which turned out to be crazy) that it would break games. But I can't find any it breaks.
This means you can now use speeds 3 and 7 (other previously-forbidden ones cause jerky movement, will try to fix that later). However, the NPC editor still doesn't let you select these speeds.

Finally fixed positioning and layering of non-20x20 NPCs in the map editor.

Something looks different in the plotscripting dictionary.

Added "replace substring" (which replaces matches of a substring... what should I call a command to that instead replace character ranges ("slices") of a string? Figuring out the name is the hardest part.) And, finally, "string equal" as an alias for "string compare".

I compiled Custom for Android (temp download) because somebody asked for it for the nth time and I finally gave in. I'm surprised how much of the editor is usable even just using the on-screen buttons on a phone. As long as you don't need to type anything (no backspace key). If you have an android device with a keyboard it might be practical.

Reorganised the New Features section of whatsnew.txt for Fufluns into subsections, because it read like very long disjointed ramblings.

Spent many hours today/yesterday investigating corrupt tileset graphics and crashes in Test Game after changing layer tilesets or reordering layers. I didn't realise these were the same bug as a bunch of crash reports we've received. Took me so long because I had to draw a diagram on paper to make sense of the problem.
When map layers were implemented loading of tilesets became a mess, because tilesets may or may not be shared by multiple layers.
When map state saving/loading was added, things got worse, since map data is split across many files that can be reloaded independently.
When maps layers were converted to slices, layers of complication were plastered on top.
When "Recreate map slices when changing maps" (backcompat bit) was added, a bunch of new codepaths added to the confusion.
When Test Game was added, map reloading code doubled or tripled and it was game-over for intelligibility.
Last edited by TMC on Tue Nov 19, 2019 3:47 pm, edited 3 times in total.
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

The OHR is growing and getting more and more options. Reading your post brought me good dreams last night. Thank you a lot! We will see sharper games thanks to your efforts in improving the engine! So much has changed in the last 6 years.

Do the new walking speeds offer other possibilites than 3 and 7 (in concept)? I tried out a speed of 6 and it looked, like the character is limping (very funny, or is that the test for a future bitset "NPC is limping").
My last idea with the OHR has something to do with hero walking speed, because it is a drone race! Navigating through a track with a speed of 20 becomes a test of reflexes and concentration. Having other speeds available, especially higher ones, would open the world for 2D racing games. The question would be, what a sane limit is. On a 400 MHz Celeron from 98/99 a walking speed of 20 was just a bit slower than on newer computers (therefore, the race was easier, but just a bit).

Some suggestion: What about a "Disable Main Menu" under "Edit General Map Data"? There might be certain maps, that are there for minigames only, or intros, or even graphical menus, where no suspend player can be used. Getting around this with while loops... doesn't feel good. Or is there a better possibility than the one in the wiki?

Would you allow me to remove all the images in the plotscript-dictionary and replace them with text symbols like (?) or (!!!)? It will look as good as before and will load a bit faster. Also, we will have less traffic for the server, because it has to load the little images from the there every time the plotscripting dictionary is accessed.
Attachments
Drone Racing with the OHR
Drone Racing with the OHR
dronrace.gif (293.74 KiB) Viewed 2767 times
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Wednesday: A productive day. Didn't touch the OHRRPGCE.

Yesterday: An unproductive day. I spent quite a while looking into loop points in .ogg. So we plan to implement that when time permits.

Today (so far):

Walkabouts still realign to the grid every tile, so a speed of 6 results in moving 6, 6, 6, 2, 6, 6, 6, 2, etc. Speed 7 results in 7, 7, 6, and 3 results in 3, 3, 3, 3, 3, 3, 2, so they're good. In future I'll we'll fix the realignment problem.

A per-map setting to disable the main menu sounds like a good idea to me.

Regarding the icons in the dictionary: the problem was that even if you have a local copy of the dictionary included with the engine, the the icons aren't included, instead they're accessed from the wiki. I was aware of the problem but didn't bother fixing it properly. I've now done so: local copies of the icons are used.

While I was at it, I also added the plotscripting dictionary to Windows nightly builds... and then added a game.exe-only zip, so that distributing for Windows from Mac/Linux is much faster.
Last edited by TMC on Fri Nov 22, 2019 5:32 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

OK, I figure it would also useful to anyone who wants to disable the main menu on every map, so I added a per-map "Main menu available" setting. I figured it would only take a few minutes but I was wrong.
Post Reply