Did you take a look at Tag-Along-Todd but couldn't fathom how to alter it to your purposes, and feel daunted by the perceived complexity of it all?

Then fret no more!

Introducing P-Machinery 1.0, a very simple game engine and framework for programming games for the Intellivision.

P-Machinery includes a very basic game skeleton, with a state machine that supports a flexible set of game states such as "Title Screen," "Play," and "Game-Over." Support routines to change between states and handle background tasks make starting a new game easier than before. Just add game logic, graphics, and a bit of water*!

At its core, P-Machinery includes the three main components of a game engine:

A flexible game state machine and main event loop,

An event-driven controller input decoder,

A task scheduler, and queue manager.

Along with these basic components, it includes a whole set of macros and support routines to help in allocating and managing memory and graphics.

There's one (rather large) caveat, I haven't prepared documentation for it. I always intended to include the demo with a tutorial on how to implement a simple game (Pac-Man!), but I never got around to it. However, the code is obsessively commented, so it should be easy to follow what it's doing.

The first introductory chapter of the tutorial can be found in the "doc" folder. Once I finish the tutorial, I expect to release it into the Public Domain. I hope it is useful to somebody.

And just to prove that it works effectively, know that the demo is exactly the core of Christmas Carol devoid of any game logic and graphics driver.

Could you create a set of macros for your engine to obfuscate the assembly underpinnings a bit more? I know not assembly, but, stuff like:SETSCORE 10000ADDSCORE 500MOVESPRITEA 24, 18SETBGCOLOR $1Fetc..

Actually it has a lot of that (though perhaps not those functions specifically). It is not intended to replace Assembly, nor is it aimed at non-programmers. Its purpose is to streamline programming and letting beginners have a basic infrastructure ready upon which they can build game logic.

Most tutorials walk you through coding a title screen or how to set-up the ROM header for a game. With this framework, you have all that ready. You just need to provide your game specific logic and events, but the general skeleton is ready to go.

The engine will start the game, set-up the environment and display a basic title screen. At that point, it accepts any input from the title screen and automatically engages "Play" mode, which is the main game loop. During this mode, it polls the controller and triggers events when input is received. Your game can assign event handlers for these and do what it needs to do, and any tasks you add to the queue or schedule for later will automatically be run when ready.

All that basic functionality is already built-in. A lot of it is built using the SDK-1600 library provided by Joe Zbiciak.

sorry a bit more explanation: your package provide an assembler template? the template is calling external libraries made by you?so you take the template and start from this?

I'm sorry, but it's nothing as sophisticated as that. I guess the best way to describe it would be to say that it is just a game skeleton. All the basic scaffolding is there to execute a game:

- The ROM header- The ISR game loop- The state machine- The task queue- The controller input decoder

If you take the source as is, assemble it, then run it, you'll have an executing game that does absolutely nothing more than display a title screen. However, under the hood, it is actually running the game loop and waiting reading the controllers; it just has no game logic to perform.

I intended to include a tutorial with it, teaching how to build a simple game step by step, but I never got around to it. I'll do so eventually. The code, however, is heavily commented and gives hints on what could be done at each point.

Just to give you an idea of what the code skeleton provides, consider the following routine. This is the "Level Initialization" routine, intended to initialize the game world when a new level starts (or when the game starts, if there are no levels).

Notice that it has lots of comments on what it is doing, and gives you ideas of what else to add for your own game.

And below is the main "Game Play" engine. This routine is called continuously from the game loop to update the game world. Notice how it just performs some "housekeeping" stuff like check for pause and process timers, but it hints as to what you could add for your game.

Valter, just to give credit where it's due, my game engine uses Joe Zbiciak's SDK-1600 programming library, and was designed to use Joe's as1600 assembler. P-Mach just puts it all together into a re-usable skeleton, and builds upon it.

Valter, just to give credit where it's due, my game engine uses Joe Zbiciak's SDK-1600 programming library, and was designed to use Joe's as1600 assembler. P-Mach just puts it all together into a re-usable skeleton, and builds upon it.

I get error "The program needs Include dependencies: you must save it in IW folder or a sub folder"

I'm guessing this error is coming from "Intelliware" somewhere. "IW folder" sounds like something to do with the Intelliware environment.

On my machine (a Macbook), I1. downloaded pmach2. found all the missing include files (except for pause.asm).3. Then I commented out the include for pause.asm.4. After that I was able to assemble and run the pmach-test program.