Official MICRO-blog THREAD for "Finish Your Damn Game Engine"

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Post by Taco Bot »

I'd sell my own grandma for floats, arrays and proper string support.
Sent from my iPhone
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Currently at a weeklong summer school on mathematical logic. Don't have a cable for my netbook :/ had hoped to get some stuff done before leaving but was too busy packing/preparing.

Tacobot if youre THAT keen maybe you could even help... new hamsterspeak feats would be the next major project. Not sure which parts could be given to others aside from testing. Maybe library functions. Know C or lua?
Last edited by TMC on Mon Jan 09, 2017 9:36 am, edited 1 time in total.
User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Post by Taco Bot »

I know a bit of each, yeah. Though I'm not sure if I'm confident enough in my coding abilities to contribute to a public project...
Sent from my iPhone
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

If you're still worried about contributing, then you haven't read enough warnings about the code quality ;) Was it you who put forward the idea of writing a proper manual for HamsterSpeak, or creating a .pdf? We're going to need a lot of new documentation.

-----

OK, back. Spent a few days on quite a lot of distractions like .gif export (more on that when it's finished), code cleanup, dealing with problems Marionline found, and the code for 24-bit colordepth (which is currently only used for importing 24-bit bmps and anything else is still a long way away). Then the summer school took 8 days, and I reserved couple days for my studies (it didn't help).

Today I just took on an easy task, adding the ability to delete a doorlink. And then, because it was completely unrelated, while I was there I improved some other stuff, like making it use the correct Crop/Wrap/Default-tile edge mode. Invariably that descended into more code cleanup all over the codebase (this time trying to fix some menu scroll position glitches).

Before:
Image

After:
Image

(Damn, this is the second time I'm posted screenshots of work on this menu. There's always more to do!)

It's erally easy to get offtrack when you're continuously stumbling upon bugs like this misdrawn oversized Yes/No prompt:
Image

Next time, I'll try to address Surlaw's complaint by adding backdrops larger than 320x200 and update the battle system to display OK at higher resolutions (without actually doing any of the hard work to convert it to slices).
But something I've been wondering for years is "Should backdrops have animations (and multiple frames) too?"
I thought I had settled on "No", but after a thread today I'm thinking of revising my answer to "Yes (eventually)". Then backdrop slices would stay completely compatible with other types of sprite slices. Maybe this is a crazy idea without enough benefit.
The important thing is to go ahead with a new file format for backdrops now, and worrying about animations in the future.
Bob the Hamster wrote:I wish I had more free time for OHRRPGCE work right now.
I'm going to have progressively less time over the next three months. That's why I'm trying to get lots done before I get really busy and disappear! We should release before that point, or it'll just be unnecessary delay.
Last edited by TMC on Tue Jan 17, 2017 7:04 am, edited 1 time in total.
User avatar
Ichiro
Slime Knight
Posts: 238
Joined: Sat Sep 11, 2010 1:20 am
Location: john madden

Post by Ichiro »

I could probably write a program to turn the XML file into a LaTeX file if we're going the PDF route. That would probably be a start...

Also, if you want, speaking of PDFs, I can probably make a RPG format specification PDF from my work on HamsterLib.
Last edited by Ichiro on Tue Jan 17, 2017 10:30 am, edited 1 time in total.
Image
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I think the plotdictionary is fine in HTML format (and the RPG format as wiki pages), but some people might like having .pdfs of them (Are there good tools to turn series of mediawiki articles into pdfs?)
I meant writing a proper reference manual of the language itself (kind of what the HamsterSpeak Specification was but never really achieved). I feel like the plotdict isn't a good place to put that, although it does already document flow control, etc.
HTML is probably better than PDF for most purposes, but we should just write the manual in some markup language that can easily be translated to HTML or PDF. In particular I can't see any reason not to write it as a series of articles on the wiki.

That brings me to a related thing. The F1 help pages are all written in plain text. It would be really nice to switch to a markup language instead. Then we can add clickable cross-links between and within pages, URLs, collapseable sections, titles, tables of contents, indentation which reflows the text depending on the window size, highlighting/colors, and maybe even embedded images. Those would be so great. It doesn't make sense to invent our own markup (except for specifying colors and fonts, which will be used throughout the engine) instead of using an existing one (or a subset)..

An obvious option is, again, mediawiki markup, but we already decided that duplicating pages about script commands on the wiki was an awful idea, and deleted them all, along with all the pages about specific editors, which were uselessly incomplete. So I assume the help pages won't appear on the wiki. Instead we should host html versions of them so that there could be lots of cross-links between the wiki and the help pages.
If we're not actually hosting them on the wiki, it would be possible to use something else like markdown. But it would still make sense to use mediawiki markup so that material can be moved from one to the other easily. And if some wiki pages are heavily linked to then it might make sense to convert them to help pages which can be viewed offline.

So, we will need a parser for mediawiki or whatever. Possibly taking an existing parser and adapting it. It doesn't need to be written in FreeBasic. A converter to HTML will already exist.
Last edited by TMC on Tue Jan 17, 2017 11:44 am, edited 2 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 »

Look! TMC is secretly doing amazing things!

As of the next nightly wip build, you will be able to press CTRL+F12 to record a gif of your game!
Attachments
vorpalflorist0000.gif
vorpalflorist0000.gif (7.2 MiB) Viewed 3956 times
Last edited by Bob the Hamster on Tue Jan 24, 2017 4:10 pm, edited 1 time in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Bob the Hamster wrote:Look! TMC is secretly doing amazing things!

As of the next nightly wip build, you will be able to press CTRL+F12 to record a gif of your game!
Brilliant! That will really come in handy for posting info about progress in threads like this, instead of having to upload an rpg file to the Games page for people to see stuff in action.
My pronouns are they/them
Ps. I love my wife
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6461
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Thank god... I hate third party recorders.
Also, that's one heck of a gif.

Ohr sidescrollers for life✊️
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Post by Foxley »

I've began finding my feet in terms of coding over the past year or so, to where I've at least gone from "I'm terrible at coding" to "I can probably figure out to code a few things". Knowing how ridiculously unfair it is that just James and TMC are doing all the dev work at this point, I think I'd be interested in at least trying to help with relatively simple fixes and feature solutions in the near future.

Thing is I've never touched FreeBASIC before and haven't used Qbasic since the late '90s. Are there any good resources for getting started with FreeBASIC kicking around? Also does the engine use any supporting languages or frameworks that would be useful to know?
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Yes, I have a bad habit to not want to release stuff until it's completely done, so things have been piling up; I should aim for short progress updates instead.

It would be great to have more help! I can't blame Mike, Simon, Jay and Yuriy for not sticking around for a decade, but progress has been much slower without them. If you want, I could go through my todo list and pull out the easiest things (those that require the least knowledge of the codebase). One example might be to convert all the in-battle attack and attacker animations to the new animation system (but I'm not far along enough for that yet).

Basically, no, there's nothing aside from FB to learn. There's some low-level C/C++ code that normally you would never need to look at. Some script commands are implemented in plotscr.hsd in HamsterSpeak. HSpeak is written in Euphoria, but it's very rare that HSpeak is modified. We don't use any libraries aside from those used by the backends (SDL, DirectX, Allegro). We have our own disorganised collection of utility code, and often write "non-standard FB" (for example, GOSUB-RETRACE). There's a page on the wiki to document that non-standard stuff and other things you should know.
In future, I would like to write/convert more of the engine in/to HamsterSpeak, e.g. attack hit calculation, but with the current script interpreter it wouldn't be practical, so no, we don't use any scripting languages. (Although the current battle animation system is like a mini scripting language... possibly the best candidate to be converted to HS.)

I never sat down to learn FB, I just slowly picked it up as the source code was converted from QB to FB and as FB evolved. I still look things up in the FB documentation often. I have noticed that the Programmer's Guide section on the FB wiki is often better to learn from than the main documentation section, but it's incomplete. There's also a tutorials section.
Finally, note that the OHR is written in a mix of different code styles and conventions, e.g. object orientation is still used almost nowhere. It's a mess.

Sigh, I've noticed a bug in the .gif export, white pixels appearing after a fade out:
Image
Has anyone else noticed that? Only seen it here. Strangely, it doesn't happen with a different copy of powerxe.rpg with the same titlescreen. I can't figure out the problem (and don't want to, right now). Also, during a fade certain 'overlays' such as the FPS counter appear in the recording, which are normally hidden. And I just spent ages tweaking it to hide delays if your computer lags a bit or there are long loading times. Always more to fiddle with...
Last edited by TMC on Wed Jan 25, 2017 4:25 am, edited 2 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

OK, I give myself 0 out of 10 for staying focused.
I've been doing a lot of work on the engine, but nothing on my supposed top priority, animations, in weeks!
Well, I did do one thing on animations: a function to export an animation as a .gif, either transparent or opaque:
Image Image
(I'm not planning to allow importing animations from gifs.)

Instead I've followed a long line of distractions, mostly triggered by questions in the Q&A forum:

I never did finish fixing the problems I found in/as a result of marionline's thread. I noticed that the Distribute Game menu would unnecessarily redownload files every time... which turns out to be intentional, to avoid two bugs that occur otherwise. I worked out how to fix all that, but didn't complete it.

guo asked about the random battle countdown, so I ended up adding the get battle countdown/set battle countdown commands. These are completely trivial commands, but it's amazing how much time is involved in testing, documenting, and carefully doublechecking how the countdown works: I discovered the Formation Set Editor was gave wrong information about how frequent battles are. Also devised a clever algorithm to calculate exact average battle rate, but for once ended up using a simple approximation instead.

Next, after Foxley's thread I decided to implement the
check wall collision x/y and move slice with wallchecking commands. These are intended for one-line solutions for wall-checking in any kind of game, whether platformer, arcade, or RPG with tile-based or pixel-based movement. I'm tempted to try writing a basic platformer with a minimal number of lines of script.

You can already write a script to do the same thing, and I have before, but it still took me a long time (I wouldn't have started if I'd known). But as a bonus, implementing this gets us most of the way towards fixing the way that the builtin wallchecking/movement breaks down when you become misaligned. And a little towards pixel-based movement.

Here's the testing game I created for it, wall_collider.rpg (the script is in the plotdictionary as an example):
Image
Notice that diagonal movement badly requires the ability to slide along walls when blocked. I'll be adding an extra argument to do that, at some point.

Unfortunately I've discovered that there's a bug:
Image
I can guess what the cause is: there's floating point arithmetic and rounding error involved, but I thought I could ignore it, as I wrote in the code:

Code: Select all

   ' Due to rounding, pos.y might be 1 pixel past the collision point, but this
   ' should not allow it to exceed nextalign.y.
Virtuous Sword asked about tag conditions on battle menu items. It's been on my todo list a long time, so I added it, and more options. Go crazy. (Note that James is entirely responsible for rewriting the battle menu system and creating the editor, stopping just short of adding tags, so deserves nearly all the credit.)
Image


But the single hugest distraction was adding .gif export. The reason I did this is quite crazy: you could already hold down F12 to take a screenshot every frame, and very easily assemble them into a gif with Image Magick ("convert -delay 6 gamename*.bmp output.gif"), but it was annoying/hard to hold down F12 while trying to demonstrate stuff for the purpose of this thread. I thought "hey, I'll just find a library for creating .gifs, plug it in, add a debug key, and be done in two hours!". That was three weeks ago. I quickly picked the completely obscure gif-h, because it was tiny and well written, which makes it easy to customise if needed, yet packs in several interesting algorithms like palette creation with balanced k-d trees and LWZ compression. Plus it works on 24-bit images, using Floyd-Steinberg dithering.

Well, of course it doesn't actually support 8-bit images, so I had to implement that. And sharing palettes between frames, to produce smaller files. And then I wanted to produce transparent .gif too for some reason. Oh, and I want it to work even if I resize the window in the middle of recording. So what was the point of picking gif-h, exactly? And now there's still that bug remaining (see above), plus I see warnings about some gifs it produces, which I fear indicates a bug in the LWZ encoder.

Anyway, today I added automatic compression of recorded .gifs by silently running them through the gifsicle tool if it's available. This gets them to 20-80% of the size the OHRRPGCE spits out (recordings of Custom compress very well, James' Vorpal Florist gif only shrinks to 80%). You can download gifsicle for Windows here, and place gifsicle.exe next to game.exe/custom.exe, or put gifsicle in your PATH on Unix. I've also now limited the .gif framerate to 30; you can override it with the --giffps commandline option.

So, Ctrl-F12 now records a gif, but before that it did something else: played a macro (recorded keyboard input). This was undocumented and unfinished. Maybe 'macro' isn't the best term, since it can be used to record game playthroughs too -- you might remember the thread where James asked for recordings of games. James did all the work actually implementing the dang thing (see a trend?), I've just been trying to make it more user friendly.
(Unfortunately, it still has issues, as evidenced by the Tim-Tim recording not working, and the fact that it doesn't support the mouse. I have a lot of improvements planned.)

Rather than just remap that key to something else, for no good reason whatsoever I spent most of an afternoon adding a menu for the macro system, Ctrl-F11. Works everywhere in Game and Custom.
Image
(Now I can record a .gif of recording an .ohrkeys file!)
You can see the playback info box that comes up (which I added last year hoping it would be useful for watching recording of games). You can also hide it, pause, stop, speed up and slow down (left/right keys). The 2886 FPS is not an error (I've reached over 9000). I had to add frame-skipping just now to achieve that, but it's still actually drawing all the frames, just not displaying them.

Not going to mention the endless other code cleanup and problems along the way and bugs I introduced :)
Last edited by TMC on Wed Jan 25, 2017 6:20 pm, edited 6 times in total.
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

Wow! Gif Export and Macros! :o

This is cool! Macros might save a lot of game making time.
I like the animated gifs! :D

Tags on battle menu also sound useful. I'm not sure, if I remember correctly, wasn't there the idea to change the battle editor on the long run?
If you want, I could go through my todo list and pull out the easiest things (those that require the least knowledge of the codebase). One example might be to convert all the in-battle attack and attacker animations to the new animation system (but I'm not far along enough for that yet).
A at the moment, I don't have time, but I'd like to try to help with that, too.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

We plan to convert battles to slices, and let you edit the user interface in the slice collection editor. Since the enemies/backdrop are placed in the formation editor and the battle menus are edited in the hero editor, what's left to edit is mainly the appearance/position of the ready and HP meters and the attack caption. The spell lists and item menu appearance would also be separately customisable as slice collections.
User avatar
Ichiro
Slime Knight
Posts: 238
Joined: Sat Sep 11, 2010 1:20 am
Location: john madden

Post by Ichiro »

For the battle-slice revamp. Could there be script commands for finding out whose turn is next in turn based battles so for example you could put a turn list on the side of the screen?
Image
Post Reply