Yet another OHRRPGCE dev blog

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Well I got pretty far off the Fufluns track today. And it feels like I didn't accomplish much. Oh right, I wasted a lot of time getting the Map editor settings menu to display correctly regardless of window size. In fact I threw away my first attempt. The generic menu code, especially for positioning and sizing menus is IMO the most problematic code in the whole engine. It always seems to be impeding me.

<img src="http://tmc.castleparadox.com/pics/ohrbl ... ttings.png">
New features highlighted.
You can now have NPCs display in all edit modes, which is useful because they are often using instead of tiles for parts of the map. You can also control whether NPCs appear above all map layers (default for NPC placement mode) or with correct layering.

Hitting Ctrl-N to cycle NPC visibility modes: All, Not tag-conditioned, None.
<img src="http://tmc.castleparadox.com/pics/ohrbl ... w_npcs.gif">

Also fixed positioning of non-20x20 NPCs in exported map images (a feature I think many people don't know about).

And then started on something actually important for Fufluns (though James already struck it off as a blocker): a workaround for slow minimap generation/map preview. While I know to optimise it, it's a bit involved, so instead I'm just going to make minimaps generate a bit at a time instead of freezing the program.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Wasted a lot of time investigating and fighting some code bloat (in vector type tables), in the end I managed to trim 400 bytes from game.exe... which is so close to zero that I doubt it's even worth the cost of adding another confusing macro. I'll probably just throw away that change.

Anyway, this minimap preview works so nicely (and worked on the first try) that I could totally remove the delay before starting to generate the map preview. However...
Image
...this is even more painful to look at in a large window/fullscreen.

After a lot of experimenting, I think that previewing at 1x zoom instead of full size when you're scrolling through the list works well.
Image

UI is always really time consuming, because I typically spend a lot of time making minor tweaks, and throw away a high proportion of work. In this case I think this was the 6th or 7th behaviour I tried. Expected to get a lot more done today.

The only sad thing is all the work I had put in (a year ago) in order to be able to move the minimap render code to a worker thread as had been my plan, by getting parts of the codebase concurrency-ready. (We currently only use one thread.) Looks like I won't be using that for anything.
Last edited by TMC on Mon Nov 25, 2019 3:35 pm, edited 2 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Unbelievably, I spent another day on the map picker menu, this time making sure it's responsive even on a very slow machine (it wasn't). Spent a lot of time investigating exactly where the time was being spent, and made it delay doing any previewing if there isn't enough idle time available. (The old "mapedit.instant_minimap_threshold" config option is removed.)
Found out that the real reason the map picker was slow was because it was reloading all the map names every time you moved the cursor! (That was a mistake when I originally added the previews.)

Also writing utility code, cleanup, etc.

This was warmup, because next I'm going to be going deep into optimising data loading when you enter a thingbrowser menu, and some Windows-specific file I/O glitches.
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

We have a crash on Windows 95 while using the text search at the text boxes (regardless of what was entered in the box). The crash was there in april's nightly, too. On the same computer with Windows XP it's fine.

Code: Select all

Loading C&#58;\OHRRPGCE194\support\CrashRpt1403.dll
 0,3  LoadLibrary&#40;C&#58;\OHRRPGCE194\support\CrashRpt1403.dll&#41; failed&#58; A device attached to the system is not functioning.
Couldn't find/load crashrpt.dll
exchndl.dll not found
 0,5   ----Starting OHRRPGCE Custom----
 0,5  11-27-2019 09&#58;02&#58;01
 0,5  OHRRPGCE wip 20191123.11434 gfx_directx+sdl+fb/music_sdl FreeBASIC 1.05.0 &#40;01-31-2016&#41; GCC 5.3.0 x86 pdb  Built on vampirecell -g -gen gcc Win32 32-bit
 0,5  exepath&#58; C&#58;\OHRRPGCE194, exe&#58; C&#58;\ohrrpgce194\CUSTOM.EXE
 0,5  orig_dir&#58; C&#58;\ohrrpgce194
 0,5  curdir&#58; C&#58;\OHRRPGCE194
 0,6  Runtime info&#58;   music_sdl, SDL 1.2.15, SDL_Mixer 1.2.12  Windows 4.0.67306684 &#40;95&#41;  C, ANSI codepage&#58; 1252
 0,6  documents_dir&#58; C&#58;\WINDOWS\Desktop
 0,7  Initialising gfx_sdl...
 0,8  recenter_window_hint&#40;&#41;
 1,0  SDL&#58; screen size 2x19441
 1,0  setvideomode zoom=2 w*h = 640*400
 1,1  gfx_sdl&#58; created screensurface size=640*400 depth=16 flags=0x0 R=0x7C00 G=0x3E0 B=0x1F
 1,1  gfx_sdl "SDL 1.2.15 &#40;0 joysticks&#41; Driver&#58;windib"
 1,1  unlock_resolution&#40;320,200&#41;
 1,1  setvideomode zoom=2 w*h = 640*400
 1,2  gfx_sdl&#58; created screensurface size=640*400 depth=16 flags=0x10 R=0x7C00 G=0x3E0 B=0x1F
 1,2  music_sdl, SDL 1.2.15, SDL_Mixer 1.2.12
 2,0  music_sdl, SDL_Mixer 1.2.12 &#40;22050Hz, Music decoders&#58;WAVE,MODPLUG,NATIVEMIDI,OGG,MP3 Sample decoders&#58;WAVE,AIFF,VOC,OGG&#41;
 2,0  Working in C&#58;\OHRRPGCE194\OHRRPGCE-settings\working0.tmp
 3,5  setvideomode zoom=2 w*h = 640*400
 3,5  gfx_sdl&#58; created screensurface size=640*400 depth=32 flags=0x10 R=0xFF0000 G=0xFF00 B=0xFF
 4,3  check_ok_to_open...
 4,3  pid_current_exe = <unknown>
 4,3  prev_session.workingdir = C&#58;\OHRRPGCE194\OHRRPGCE-settings\working0.tmp
 4,3  prev_session.info_file_exists = YES
 4,3  prev_session.pid = -2070535 &#40;exe = <unknown>&#41;
 4,3  prev_session.running = YES
 4,3  prev_session.partial_rpg = NO
 4,3  prev_session.fresh_danger_tmp = NO
 4,3  prev_session.sourcerpg = 
 4,3  prev_session.sourcerpg_old_mtime = 0
 4,3  prev_session.sourcerpg_current_mtime = 0
 4,3  prev_session.session_start_time = 2019 Nov 27 09&#58;02&#58;03
 4,3  prev_session.last_lump_mtime = 0
end_debug&#58; no debug/error messages during startup &#40;skipping rest of startup&#41;

 4,3   ----Loading a game----
 4,3  11-27-2019 09&#58;02&#58;05
 4,3  curdir&#58; C&#58;\OHRRPGCE194
 4,3  tmpdir&#58; C&#58;\OHRRPGCE194\OHRRPGCE-settings\
 4,3  settings_dir&#58; C&#58;\OHRRPGCE194\OHRRPGCE-settings
 4,3  Editing game C&#58;\OHRRPGCE194\revolte.rpg &#40; &#41;
20,7  Full game data upgrade...
20,7  Last edited by&#58; &#91;&#91;OHRRPGCE wip 20191123.11434 gfx_directx+sdl+fb/music_sdl FreeBASIC 1.05.0 &#40;01-31-2016&#41; GCC 5.3.0 x86 pdb  Built on vampirecell  -g -gen gcc Win32 32-bit&#93;&#93;
20,7  archinym creation info&#58; OHRRPGCE beelzebufo 20130410
The Top-level thingbrowsers option is very useful on a 1998 Celeron. We need an option to disable the preview maps too. When using former versions of Custom.exe, I remembered maps by name and by number. The preview maps are some other option for some other users.

Maybe change the name of the option "Top-Level thingbrowsers" to
"Top-level browsers: NO (for slow PCs)"
"Top-level browsers: YES (recommended)"
The current names are sooooo long.

I'd like to address one other problem by myself, but didn't succeed so far. I want to get rid of that decimal point behind the elemental percentages. It looks so incredibly stupid: "200,% damage from Fire". Does this has something to do with declaring the values as SINGLE? Why not using SHORT or INTEGER variables instead? Is a big decimal number necessary? I currently run in a lot of "Type Mismatch" errors when trying to modify the source code.
Last edited by Bird on Wed Nov 27, 2019 8:52 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Wednesday
A very productive day. Didn't have time to work on the OHRRPGCE. Started baking a cheesecake.

----

Thanks for the crash report, will investigate. Probably similar to the cause of the first Win95/98 crash you reported.

An option to disable the map previews shouldn't be needed (see my last post).
And yes, "(for editing on very slow computers)" is a bit long.

"200.% damage from fire"? I haven't noticed that. I guess I just wasn't very observant. That shouldn't happen, but maybe FreeBasic's FORMAT function is being silly, and switching to strprintf will fix it. But strprintf is new since 2013 :)
I do agree that it was over-the-top for me to use floating point for the elemental resists. I regret how I implemented them. Even being limited to a granularity of 1% would have been a very minor problem. And 0.1% would have been no problem at all.
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 »

I want photos of the cheesecake
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

Seems that life is not all about computers. *sigh*
TMC wrote:...but maybe FreeBasic's FORMAT function is being silly, and switching to strprintf will fix it. But strprintf is new since 2013 :)
Does this has to be changed at a central place in the code? How are the functions called, that need to be altered for the elemental percentage number? I see that there are more places, where the elemental calculations are done, like in the hero editor or at the status screen. This will be interesting.
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

Wait! Isn't it just this line? (In 2013 common.rbas, FUNCTION format_percent. The current code looks more nested at that place.)

Code: Select all

DIM repr as string = FORMAT&#40;float * 100, "0." & STRING&#40;deciplaces, "#"&#41;&#41;

needs to get replaced by this

Code: Select all

DIM repr as string = FORMAT&#40;float * 100, "0"&#41;

The ugly comma is gone! Horray!
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 »

That looks like the right place!

It should be possible to add an IF that includes the dot when deciplaces is not zero
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Thursday
Another one of those productive days. Baked a cake.
Image

Friday
Well, it turns out that this Friday was not Fufluns Friday. I did spend some time doing some extensive investigation of a bug report in "new keypress". It did not reproduce.

...

Ah, I added code to format_percent/format_float to remove the surplus dot already back in 2010. However I didn't anticipate that "," instead of "." will get used in some locales, which is the problem. So this is actually a bug report; thanks. Fixed. I also discovered that in the ps_AF (Pashto (Afghanistan)) locale there is a bug in FreeBASIC's FORMAT command, and I've worked around that bug too (although the utf8-encoded decimal separator Ù« will not display correctly in the OHRRPGCE yet).
Last edited by TMC on Fri Nov 29, 2019 10:17 pm, edited 3 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Can't believe I was still [s]wasting[/s] spending time on minimaps today... I could go on. Someone just pointed out that minimaps are cut off in-game if the map is more than 200 tiles high.

Finally finished code cleanup and tweaking the map preview changes and pushed them to svn.

Added a "mapedit.preview_with_minimaps = NO" .ini config file option to disable map previews, since it was only one line of code. I admit it might still be annoying.

Then on a whim (because it was easy) I decided to add a new minimap style, which is just the default one but then mapped to the master palette. I didn't add that originally because the code for mapping to the master palette was slow.
Here's an example (map from Viridia) of the four minimap styles (the new option is the 2nd one), picked because the differences are bigger than typical:
Image Image
Image Image
The 4th one, of course, is what minimaps look like in etheldreme!

OK, something more significant: working on finally adding an option to resize spritesets.
Also been planning future script interpreter features on the side.
Last edited by TMC on Sat Nov 30, 2019 12:56 pm, edited 2 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

We just passed the two year anniversary of Etheldreme!

:zombie:

Didn't actually finish the sprite resize option yet. Instead, believe it or not, spent three days on the main Fufluns release blocker: that the OHRRPGCE doesn't run on the latest Mac OS release. It's slow going because I don't have access to a Mac at the moment, so have to make half-blind changes to the build scripts and wait a day for the nightly build to see whether it works. Changes to the master build script which updates itself take two days to take effect. But James and I hit a major snag: we don't have 64-bit builds of the utilities to encode .ogg files.
Plus tonight, more work hunting down Android 9 problems. Porting your software to multiple platforms is a workload multiplier!

On the bright side, that's three days not spent on minimaps.
Last edited by TMC on Wed Dec 04, 2019 2:56 pm, edited 2 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Fufluns Friday?

Guess not.
I did finish this Friday: Changing walking animation speed
Nothing to do with Fufluns, really. Actually I mostly implemented this a couple months ago but just got around to finishing it. Seemed worth doing.

Broken Mac builds continuing to be a painful problem. I hope something builds tomorrow.

Did some bugfixing.
I wasted hours yesterday and this morning trying to figure out why there were random pauses in hero movement in 6curses.rpg. I noticed it in delinquent.rpg too, so first I blamed Feenick's scripting but decided to check. Added something to the new (unfinished, unreleased) timing debug mode I started on recently, and saw there was no script to blame. Then I noticed it in other games, so I blamed my recent minor change to the framerate control code, and inspected that for a while. Then I suspected my changes to keyboard handling in Fufluns; still nothing. Finally I checked raw key input from SDL and realised my keyboard was to blame. More specifically the crappy ps/2 to usb adaptor I had. Problem between keyboard and screen. Bought a new keyboard today. Bug fixed.
Last edited by TMC on Sat Dec 07, 2019 2:48 pm, edited 3 times in total.
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 »

E-mail me if you want me to trigger any early Mac builds this weekend
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

TMC wrote:...ps/2 to usb adaptor...
So the reaction time was greater when using this old keyboard conversion device? What were your experiences with it so far? Or is your keyboard in its last key strokes? Just curiousity.

Please keep telling us about the problems you are facing so that we know, what we might try and test. I will get access to a friends Mac-Book next month, if any more testing will be required then.

Changing the tick rate for steps works fine. The 1 ticks/frame could be used for some very quick action with non-humans on screen! A drone with spinning rotors for example could look good with this.
Post Reply