Tuesday, October 04, 2016

A Lua Memory Viewer

If you're new to Lua you might not know about "_G". "_G" is the global table: the table containing all objects currently in global memory. All the Lua libraries are in there, any function or variable you define is there.

When writing a large program, it can be useful to have a look inside this "_G" table to find memory leaks or monitor variable values. To this end, I've written a simple visual exploration tool that let's you navigate your global space. I wrote the program using Dinodeck as it uses some graphical functions.

Here's how it works:

You set up the Watch and call it's Render and Update functions. The Render function draws it on the screen. The Update function lets you navigate through the table using the keyboard (left, right, space, backspace).

The watch takes some filters that let you filter out common things you'll find in the "_G" table. For instance Lua functions and keywords such as table, ipairs, os etc.

Here's an example of it in action.





In this example there's a table in the main.lua file that looks like this:

a = {b = {c = {d = { text = "Hello"}}}, v = Vector.Create(0.5, 1, 2, 3)}
The values will update in realtime as they change in the program.

Source Code


A copy of the file is available here as a gist.
At some point I'll add a proper project to the dinodeck repo.
It uses these Dinodeck libraries:
  • Renderer
  • Vector
  • Keyboard

Further Work

 

This project could have more polish and features. Here are some ideas:
  • Show a history value of the selected value (like how a number changes over time)
  • Show the colour of a vector when selected
  • Add a simple console so the list can be filtered by typing in what you want
  • Edit values
  • Sort the table entries alphabetically
  • Trim key/value labels so they always fit in the boxes
  • Nicer transitions for moving through tables and highlighting key/values
  • Make the code a little cleaner. `keyData` gets passed around too much at the moment
  • Support display of other Dinodeck types like sprite, matrix etc

Wednesday, May 11, 2016

Making an RPG Book Update

 The book is now out! 
See the release post on How to Make an RPG.  

(I'll add a release post here too when I get chance!)

For the last two years (ok maybe a little longer! :o) I've been steadily working away at my How to Make an RPG project. This is a digital book, collection of art assets, step-by-step projects and game engine that helps the reader make their own Japanese style RPG. It's the book I always wanted to read but didn't exist...

It's very rare for a book to tell you, step-by-step how to make a game. I've learned the reason for that; because it's a massive undertaking! But it's nearly over :)

You can see all the details of the project here. But basically:
  • Digital book (tome really), that tells how to make a full JRPG-style game.
  • Over $2500 worth of bespoke pixel art you're free to use however you want
  • A full C++ engine with source
  • Example projects that take you step by step from sprite to full game
  • Instructions on how to create three full games: 
    1. A narrative based dungeon escape (with simple puzzle)
    2. An arena fighting game 
    3. A full but small quest based game that has everything you'd expect a JRPG to have. 
The engine supplied is in C++ but all the game code for the book is in the nicer, more high-level language: Lua. This lets us concentrate on making a game, instead of worrying about system details (memory allocation, pointers, etc etc).

The package is pretty comprehensive.  I don't deal with combat status-effects (slow, poison etc) but I intend to write an article about them post-release. The book was just getting a bit too big. (I do cover stealing, magic and special abilities, though :))

I've been writing updates on my progress and other RPG-focused stuff over on this website.

Here are some screenshots:





and there many more locales including a sewer, prison, world map, town etc and many more enemies, and a few NPCs, weapons, spells and abilities to discover.

 

Status


In early January I opened up early access for the book to the people on the mailing list. I'd had a few requests from people who wanted to purchase it early and I'd decided if I hadn't finished by January then I'd make it available. If you want early access you can sign-up to the mailing list over on this page.

Early Access Comments

It's been well received so far! Here are some of the comments I've had. (Posted with permission. There are more I wanted to post but I forgot to ask permission at the time and it feels weird asking after a few months, so these are the ones you get :D)


Your book is amazing! Best buy I've made in a while!
 - Oli Bedsole 

Your book is helping my dreams come true
- Terrence Young

I've been programming for much longer, but in the last year I've really wanted to make an old-school SNES style RPG. Your book has been well worth the money, has a load more content in it than I ever expected (when I first opened it and saw 900+ pages, I was amazed!!). Also, the step-by-step explanations with visual examples for everything are just amazing. I've been though a ton of different guides and have made Zelda clones, but the detail and depth of your guide and well-written explanations/functions, UI design, and generally everything have been amazing.
I've been waiting for this eBook since you first announced it, and I wish that I had been able to read this when I first started game development, it would've saved a lot of headaches and frustration! 
- Async0x42

Forget Early-Access When is it Out?

Since January I've released five version updates and the book text is now at version 1.0. The text is nearly ready for release.

Before release I need to:

  • Write and upload the engine documentation
  • Clean up the engine code and upload it
  • Update all the examples so they're using the correct final engine binary.
  • Make the mac version statically link the library binaries so it *just works* rather than needing a work around
That's where I am. From experience, I try not to predict when I'll have the final release but it feels like the end is in sight :)
If you have been following this project for a long time - thank you for your enduring patience!

Friday, January 01, 2016

December Book Update

Merry Christmas and a Happy New Year! Hope you had a great 2015 and are looking forward to 2016.

I'm writing a book about how to program your own computer role-playing game. Not just a book but also a vast array of example projects and useful assets. The book goes from drawing sprites to the screen to a fully featured Final Fantasy 6 style JRPG. Interested? More details here and you can sign up for the email list to be notified when it's released!

Recently I've been setting up the store and associated processes.


I'm still editing the book. This is taking longer than expected. I've had a number of people ask if I'd be willing to do early access. I decided if I wasn't finished by the end of December then I would. So; early access is coming soon. Early access will only be available through the mailing list (or if you've contacted me directly requesting it). Details soon - watch your inbox :D

What's happened since the last update?

  • 100% Art Compelete! Yay!
  • All Examples are therefore 100% complete too (barring any bugs)
  • Editing for section II about 70% complete.  
  • Editing for section III has yet to begin
  • Front Matter still largely missing.
  • Binary files for the engine included with the book are online here: http://dinodeck.com/
  • Build process that creates the book and pulls in all the examples (currently 1.3gig zipped, looking to shrink that during the early access process!)
Progress has been ok, considering how busy the end of year gets and I also travelled to PlayStation Experience for work (which was cool).

I'm currently working on making early access to the book available. Once that is done I'll jump back into editing the combat section (and integrating any feedback from early accessors). Today I've also been fixing some bugs from integrating the new art. So full steam ahead!