One thing you might look into doing that might help the read-ablitiy of your program is creating a data file and loading that rather than setting all the data with in your main program.
For example:
arrNPC
(1, 1).
Name = "Child" arrNPC(1, 1).TileNum = cTileChild1%
arrNPC(1, 1).Frequency = 100
arrNPC(1, 1).Behavior = "it"
arrNPC(1, 1).Talk = "Are you going to save the people?"
arrNPC(1, 1).Yell = ""
you have over 1000 lines of your main program made up of this data alone,
Thanks for the tip.
I have considered moving the data to separate files, just haven't got there yet (same with reusable functions, separated into libraries).
I always liked code that is "type in friendly" or copy+paste friendly (who in their right mind is going to type in 15,000 lines?!)
and putting everything in one file makes it simpler from that standpoint.
I don't even like having the tilesets & bitmap fonts in separate PNG files!
I get that in some ways it's easier to navigate smaller files,
but it is also more complicated when you have to worry about multiple files and formats,
and manage a project and dependencies. I know one big file with 20,000 lines gives people a headache,
but a project with 50 subfolders and a million files gives ME a headache, lol.
So anyway, that's why it's one big file and my approach so far has been geared toward "all in one".
if you moved all that to a second program that saved it to a file you could load from that file with 3 lines as follows
and there you save over a 1000 lines of code, reduce the length of your main program so it is easier to navigate and read, while too allowing easier changing of data at a later date by having it all in one location rather then scattered through out the main code.
You can do that with any BULK data that you use within your game, which could probably reduce your main code by several thousand lines and tens of thousands of bytes.
I see your example uses a binary format, which is more compact.
For my purposes, I would prefer to use plain text in a human readable, easily editable format.
Multiple files aren't off the table, but I would prefer for them to be editable as plain text - even the tilesets!
I considered JSON, but I haven't yet seriously looked for any QB64 / QBasic jsonify / stringify functions
(and I don't really want to write them!)
A while back I found Jsonify/Stringify for VBScript and I have used them in VBA,
but they rely on nested Dictionary objects (associative arrays).
I tried creating my own associative array in QB64 few months back,
but it was buggy and clunky, and I haven't been too excited about slogging through that.
Also, although JSON is a simple format for us programmers, it might be too complicated for kids and their parents.
I want this to be editable by non-programmers and kids. I just feel like JSON is simple, but not simple enough.
I might go with your basic DOS config file format, something like
Level=1
Name=Child
TileNum=cTileChild1%
Min=1
Max=1
Behavior=it
Talk=Are you going to save the people?
Yell=
Level=1
Name=Child
TileNum=cTileChild2%
Min=1
Max=2
Behavior=it
Talk=Please save us from the monsters!
Yell=
I haven't gotten there yet.
A lot of this program is messy and ugly and inefficient and a WIP, and I'll clean it up as I go.
For now I am just working to get a basic playable game.
A good example of this is my Dragon Warrior clone, if you check it out you will see I have 2 program source files;
--DW1_FullSource.bas which is the main program,
and a second
--DRAGONWARRIORDATA.BAS which is all the data for the game.
Thanks, I will give it a look!
The next thing I think I need to really figure out is D&D or Ultima style combat,
calculating hit/miss, damage, etc. based on player attributes (strength, agility, etc.),
different weapons, armor, skills, etc.
It's been a loooooong time since I played basic D&D and I don't remember how it worked,
but this should work kind of like classic Ultima or D&D.
There's an article I found
https://datadrivengamer.blogspot.com/2019/09/the-basic-mechanics-of-ultima.htmlthat might help.
Your project looks very interesting though, can not wait to see it finished.
Thanks - so far it isn't that remarkable, but the ultimate goal of this is to create something
that's lets people EASILY and SIMPLY create games that are a mix between classic Ultima and Infocom text adventures
(where they can control how much of the one or the other),
in the form of a construction set - think Electronic Arts' Adventure Construction Set,
but with simpler editing, using text files instead of the clunky joystick interface and the proprietary hidden data file formats that ACS used.