You can check out on video of all the Japanese people .
Good afternoon fellow dinosaurs. I would like to start with the disclaimer. I'm a nitriptist.
I'm a nitriptist. I would like to start with the disclaimer. I'm a nitriptist.
I'm not a nitriptist employee. It's important.
This presentation is mostly recycled material from Neo4f 24.
I would not assume that you guys are familiar with the fourth programming language though.
What's interesting here is the development methodology and the scope of this endeavour of course.
The development never is a straight arrow from nothing to whatever your goal is.
It's more like a revolutionary process, like most of you know probably.
The target, the target is this little board which I designed.
This old started at the end of 2018. After having experimented with the Arduino AVR platform for one,
the fact needs to go back to my digital electronic routes because that's my initial training.
I decided to put together my own 6809 single board computer which is what I just showed you.
I also had a 35 year old printout of a fourth implementation I wrote back in 1983 for the Z80.
Eventually the combination of the two gave birth to a platform which I call Z79 fourth.
This is a sort of some sort of a pun because Z80 was the original target.
And the 79 is the original fourth standard specification I tried to implement.
So this is a minimalist platform. It has the basic functional literary credits for running fourth.
Mostly from rum. Some of it comes from compact flash.
It's USB powered which is convenient. You can use any phone charger to power it.
And the serial console is over an asynchronous serial line.
For this exercise I used the ANS94 firmware variant which is kind of a modern standard.
And most importantly it's compatible with GN4 which allows of course for cross-platform development.
So I can develop onto Linux and GN4 and run on this little guy.
And obviously the Linux development is much more comfortable.
The target is the target terminal is the deck VT4 20.
So the reason for that is that USB is nice.
In my opinion if you want reliable flow control you want RS 232.
So instead of using a 500 watt PC as a console emulator I bought a deck VT4 20.
Why emulate when you can have the real thing?
Now the VT4 20 is a monochrome text terminal.
And Pacman is a graphical colleague.
Somehow, which is a typical built.
Fortunately the 420 supports a function called deck download which allows for unit defined fonts.
So this was an opportunity for custom sprites which I took advantage of.
I decided to implement differentiated aspects for each ghost as a substitute for colors.
Because you don't have colors and you want still to be able to tell which ghost is which because they have different behaviors.
The basics of Pacman everybody knows Pacman in his audience as opposed to what he wouldn't be here.
Namco is the name of a Japanese company which produced Pacman as an arcade console game back in 1979, the good old years.
I'm sure you'll know how this is played.
There is a amazing venue.
Interspersed in the maze are collectible items which are either fields or power pellets.
The power pellets of the virtue of giving Pacman some immunity against the ghosts for some limited period of time.
But they also carry a higher point of value.
So ghosts are trying to get to Pacman before he can complete going through all the collectibles in the maze.
The original mainstapology is some sort of a singularity here and here you have a tunnel.
So I decided to stay away from this singularity and I went through a different topology which is the standard Linux version by RORFORNICE.
This is here, X11 Polyx, C++.
Also, Cigwin Windows, the concession of the times are supposed.
So I selected this topology and also the object oriented approach which was really, really useful.
So method, yeah, you need one.
As Woody Allen once famously said, confidence is what you have before you understand problem.
Woody Allen obviously was an engineer, just not the technical kind, the human relationship kind.
My approach was based to greatest extent to on Jamie Pittman's the Pacman dossier, which is a comprehensive reverse engineering document about the original Z18 Namco implementation.
So there are two levels here.
Presentation layer which is the visual aspect of things.
This entitled, obviously, the design of a user defined font.
That took me 12 days full time, so it's significant and it's about 30% of the code if you omit the comments.
The business layer is the game logic and we can further divide that into basic business and AI integration, which means that each ghost has a different targeting behavior when it is in chase mode.
Eventually I've ported this fourth code to see because I wanted to run under open salaris and open VMS as well, and I'll get back to that later.
So presentation layer, the basis.
The deck VT420 offers a noticeable space of 80 columns and 24 lines plus 25 status line, which is not really addressable.
If I elected to map its sprite to the double character, or horizontally, this required 30.
Yeah, I turned myself and I should be all right.
So, this required 30 double with custom character fonts to be designed and as a result, you end up on the x-axis, its physical column is half a cell.
And vertically, a virtual row is a triceterminal row, so every club cycle you move in the virtual space one step, but physically not.
On the next club cycle you will move physically one row up or down.
So, in actuality entities are moving in space that is four times bigger than the game space.
Now, font design.
On the 420, a character as a food cell, as the deck documentation state, is defined as a 10 pixel by 16 rows.
So, you have to for each element of the maze and of the moving entities, moving objects, which I call entities, you have to come up with a design like this, and there are 30 of them.
This is a four-scode.
It's partly interpreted, this is all interpreted.
For those of you who know basic, it's like data stuff, and this is what gets sent to the terminal to define this double character.
So, it's defining three groups, which I call six holes, the significant bit is at the top.
So, if you define your character like this, you beat groupsy, simple enough, but time consuming, as well, and not really exciting work.
What should be on your own?
All right.
Objectary-oriented design.
Yeah, it's fairly simple.
This is centralized, a state information, essentially.
It uses 4th 2012 structures with pointers to methods.
Yeah, this is very simple.
There's no inheritance.
This is the method in vocator.
Very simple stuff.
I like to keep it simple.
So, yeah, all objects are equal.
But Pac-Man is always processed first in the domain engine loop.
Yeah, of course, it's instance zero by convention.
Which brings us to scheduling.
This stuff doesn't use interrupts or anything, it's just busy waiting.
So, the main loop is like this.
If we enter a level, we do level entry in it.
Otherwise, we do regular scheduling.
All the objects are invoked for the strategy method.
And then we wait for a fixed period of time, time-sliced, clock period.
The strategy method computes the next coordinates of each object in virtual space and updates it on the screen.
So, this is basic scheduling.
This works really well on a single task system.
Yes, you can do real time when this baby and it works super well.
But there's more.
There's more because the reference documents, the Pac-Man dos, he says.
At any given time, ghosts can be in any of three modes, which are scatter.
In scatter mode, ghosts converge to their home corner.
So, those are the full corners of the maze.
Is it here?
In Chase mode, it goes as its own targeting policy.
Yeah.
What should be all right?
Which depends primarily on the Pac-Man's location, of course.
I developed a time-based state automaton to implement this scheduling, which is specified in Pac-Man dos.
Again, so a sub-scalular.
Then the AI part, I don't like to change the term AI because it's not reading AI.
So, it's ghost instance, as its own targeting policy.
There's a field in the entity data structure that defines the instance number.
And based on that, we select a target and we invoke a navigation routine that targets this specific target.
So, again, nothing fancy.
In fourth, we tend to do simple things efficiently.
Now, the C port, yeah, I targeted Linux first because it's seem to be the easiest one.
But actually, I've got easier success with Solaris.
So, yeah.
If you care about portability, you care about politics, but it's expensive.
If you want to have access to the standard document, you have to pay 700 bucks.
Yeah.
Or I could use my money in various ways, I suppose.
The AI typically advocates open standards, which means that if you want the real thing, you will have to pay some serious money.
Terminal control, you need that because by default, a terminal will echo anything.
So, you need to turn it off and switch to row mode.
That was the initial design, then I switched to curses because that's the only way that the only thing that the MS can do.
Yeah.
A few primitive off-worth keywords, the system depended.
And this is where most of the porting effort was.
The MS, yeah.
You have to use poll and curses.
So, as a result of all this, you get three time response.
Really good stuff under my board and Solaris.
The next is not so great, you have to wait a few seconds before input is taken into account.
And the MS is a big disappointment because there's a bug in the sea runtime library that prevents me from handling input.
So, I can upload the phone display the maze, but the first time the program queries the keyboard status, it crashes with the EIO.
That is bad, but I guess I'll have to wait a month or two before the VSI fixes the problem.
So, this was possible thanks to Jamie Peatman, Patman Dosier, VT100.net, a Bible.
And of course, the good people at Teshnisha University's dean for the new forth conclusions.
Fourth, it's really fantastic.
You define your own concepts and you are the limit of the program.
Specification requirements? Yes. They're useful if they're done for you, like it was the case here.
You can benefit from that.
Standard, I can't emphasize enough for the value of standards.
Standards means portability, interoperability, interoperability.
And this is a great, of course, free standards are better.
And I think a really great developer develops his own tools to get to where E or she wants to be.
And that's it.