WEBVTT

00:00.000 --> 00:04.780
You can check out on video of all the Japanese people .

00:30.000 --> 00:52.000
Good afternoon fellow dinosaurs. I would like to start with the disclaimer. I'm a nitriptist.

00:52.000 --> 01:01.000
I'm a nitriptist. I would like to start with the disclaimer. I'm a nitriptist.

01:01.000 --> 01:06.000
I'm not a nitriptist employee. It's important.

01:06.000 --> 01:12.000
This presentation is mostly recycled material from Neo4f 24.

01:12.000 --> 01:18.000
I would not assume that you guys are familiar with the fourth programming language though.

01:18.000 --> 01:25.000
What's interesting here is the development methodology and the scope of this endeavour of course.

01:25.000 --> 01:31.000
The development never is a straight arrow from nothing to whatever your goal is.

01:31.000 --> 01:39.000
It's more like a revolutionary process, like most of you know probably.

01:39.000 --> 01:47.000
The target, the target is this little board which I designed.

01:47.000 --> 01:58.000
This old started at the end of 2018. After having experimented with the Arduino AVR platform for one,

01:58.000 --> 02:05.000
the fact needs to go back to my digital electronic routes because that's my initial training.

02:05.000 --> 02:13.000
I decided to put together my own 6809 single board computer which is what I just showed you.

02:13.000 --> 02:25.000
I also had a 35 year old printout of a fourth implementation I wrote back in 1983 for the Z80.

02:26.000 --> 02:33.000
Eventually the combination of the two gave birth to a platform which I call Z79 fourth.

02:33.000 --> 02:41.000
This is a sort of some sort of a pun because Z80 was the original target.

02:41.000 --> 02:50.000
And the 79 is the original fourth standard specification I tried to implement.

02:50.000 --> 02:58.000
So this is a minimalist platform. It has the basic functional literary credits for running fourth.

02:58.000 --> 03:03.000
Mostly from rum. Some of it comes from compact flash.

03:03.000 --> 03:10.000
It's USB powered which is convenient. You can use any phone charger to power it.

03:10.000 --> 03:17.000
And the serial console is over an asynchronous serial line.

03:17.000 --> 03:29.000
For this exercise I used the ANS94 firmware variant which is kind of a modern standard.

03:29.000 --> 03:38.000
And most importantly it's compatible with GN4 which allows of course for cross-platform development.

03:38.000 --> 03:45.000
So I can develop onto Linux and GN4 and run on this little guy.

03:45.000 --> 03:52.000
And obviously the Linux development is much more comfortable.

03:52.000 --> 04:00.000
The target is the target terminal is the deck VT4 20.

04:01.000 --> 04:06.000
So the reason for that is that USB is nice.

04:06.000 --> 04:14.000
In my opinion if you want reliable flow control you want RS 232.

04:14.000 --> 04:25.000
So instead of using a 500 watt PC as a console emulator I bought a deck VT4 20.

04:25.000 --> 04:29.000
Why emulate when you can have the real thing?

04:30.000 --> 04:35.000
Now the VT4 20 is a monochrome text terminal.

04:35.000 --> 04:39.000
And Pacman is a graphical colleague.

04:39.000 --> 04:44.000
Somehow, which is a typical built.

04:44.000 --> 04:56.000
Fortunately the 420 supports a function called deck download which allows for unit defined fonts.

04:56.000 --> 05:04.000
So this was an opportunity for custom sprites which I took advantage of.

05:04.000 --> 05:12.000
I decided to implement differentiated aspects for each ghost as a substitute for colors.

05:12.000 --> 05:24.000
Because you don't have colors and you want still to be able to tell which ghost is which because they have different behaviors.

05:25.000 --> 05:32.000
The basics of Pacman everybody knows Pacman in his audience as opposed to what he wouldn't be here.

05:32.000 --> 05:46.000
Namco is the name of a Japanese company which produced Pacman as an arcade console game back in 1979, the good old years.

05:46.000 --> 05:50.000
I'm sure you'll know how this is played.

05:50.000 --> 05:53.000
There is a amazing venue.

05:53.000 --> 06:03.000
Interspersed in the maze are collectible items which are either fields or power pellets.

06:03.000 --> 06:13.000
The power pellets of the virtue of giving Pacman some immunity against the ghosts for some limited period of time.

06:13.000 --> 06:21.000
But they also carry a higher point of value.

06:21.000 --> 06:35.000
So ghosts are trying to get to Pacman before he can complete going through all the collectibles in the maze.

06:36.000 --> 06:46.000
The original mainstapology is some sort of a singularity here and here you have a tunnel.

06:46.000 --> 07:04.000
So I decided to stay away from this singularity and I went through a different topology which is the standard Linux version by RORFORNICE.

07:04.000 --> 07:08.000
This is here, X11 Polyx, C++.

07:08.000 --> 07:18.000
Also, Cigwin Windows, the concession of the times are supposed.

07:18.000 --> 07:28.000
So I selected this topology and also the object oriented approach which was really, really useful.

07:28.000 --> 07:32.000
So method, yeah, you need one.

07:32.000 --> 07:40.000
As Woody Allen once famously said, confidence is what you have before you understand problem.

07:40.000 --> 07:50.000
Woody Allen obviously was an engineer, just not the technical kind, the human relationship kind.

07:51.000 --> 08:07.000
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.

08:07.000 --> 08:10.000
So there are two levels here.

08:10.000 --> 08:15.000
Presentation layer which is the visual aspect of things.

08:15.000 --> 08:22.000
This entitled, obviously, the design of a user defined font.

08:22.000 --> 08:35.000
That took me 12 days full time, so it's significant and it's about 30% of the code if you omit the comments.

08:35.000 --> 09:00.000
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.

09:00.000 --> 09:15.000
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.

09:15.000 --> 09:22.000
So presentation layer, the basis.

09:22.000 --> 09:38.000
The deck VT420 offers a noticeable space of 80 columns and 24 lines plus 25 status line, which is not really addressable.

09:38.000 --> 09:51.000
If I elected to map its sprite to the double character, or horizontally, this required 30.

09:51.000 --> 09:56.000
Yeah, I turned myself and I should be all right.

09:56.000 --> 10:12.000
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.

10:12.000 --> 10:25.000
And vertically, a virtual row is a triceterminal row, so every club cycle you move in the virtual space one step, but physically not.

10:25.000 --> 10:32.000
On the next club cycle you will move physically one row up or down.

10:32.000 --> 10:42.000
So, in actuality entities are moving in space that is four times bigger than the game space.

10:43.000 --> 10:48.000
Now, font design.

10:48.000 --> 11:03.000
On the 420, a character as a food cell, as the deck documentation state, is defined as a 10 pixel by 16 rows.

11:03.000 --> 11:18.000
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.

11:18.000 --> 11:21.000
This is a four-scode.

11:21.000 --> 11:26.000
It's partly interpreted, this is all interpreted.

11:26.000 --> 11:37.000
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.

11:37.000 --> 11:46.000
So, it's defining three groups, which I call six holes, the significant bit is at the top.

11:46.000 --> 12:03.000
So, if you define your character like this, you beat groupsy, simple enough, but time consuming, as well, and not really exciting work.

12:04.000 --> 12:09.000
What should be on your own?

12:09.000 --> 12:12.000
All right.

12:12.000 --> 12:14.000
Objectary-oriented design.

12:14.000 --> 12:17.000
Yeah, it's fairly simple.

12:17.000 --> 12:24.000
This is centralized, a state information, essentially.

12:24.000 --> 12:35.000
It uses 4th 2012 structures with pointers to methods.

12:35.000 --> 12:37.000
Yeah, this is very simple.

12:37.000 --> 12:39.000
There's no inheritance.

12:39.000 --> 12:41.000
This is the method in vocator.

12:41.000 --> 12:44.000
Very simple stuff.

12:44.000 --> 12:52.000
I like to keep it simple.

12:52.000 --> 12:55.000
So, yeah, all objects are equal.

12:55.000 --> 13:00.000
But Pac-Man is always processed first in the domain engine loop.

13:00.000 --> 13:08.000
Yeah, of course, it's instance zero by convention.

13:08.000 --> 13:13.000
Which brings us to scheduling.

13:13.000 --> 13:18.000
This stuff doesn't use interrupts or anything, it's just busy waiting.

13:18.000 --> 13:21.000
So, the main loop is like this.

13:21.000 --> 13:26.000
If we enter a level, we do level entry in it.

13:26.000 --> 13:29.000
Otherwise, we do regular scheduling.

13:29.000 --> 13:36.000
All the objects are invoked for the strategy method.

13:36.000 --> 13:43.000
And then we wait for a fixed period of time, time-sliced, clock period.

13:43.000 --> 13:53.000
The strategy method computes the next coordinates of each object in virtual space and updates it on the screen.

13:53.000 --> 13:56.000
So, this is basic scheduling.

13:56.000 --> 14:04.000
This works really well on a single task system.

14:04.000 --> 14:12.000
Yes, you can do real time when this baby and it works super well.

14:12.000 --> 14:13.000
But there's more.

14:13.000 --> 14:20.000
There's more because the reference documents, the Pac-Man dos, he says.

14:20.000 --> 14:27.000
At any given time, ghosts can be in any of three modes, which are scatter.

14:27.000 --> 14:30.000
In scatter mode, ghosts converge to their home corner.

14:30.000 --> 14:35.000
So, those are the full corners of the maze.

14:35.000 --> 14:38.000
Is it here?

14:38.000 --> 14:45.000
In Chase mode, it goes as its own targeting policy.

14:45.000 --> 14:48.000
Yeah.

14:48.000 --> 14:53.000
What should be all right?

14:53.000 --> 14:59.000
Which depends primarily on the Pac-Man's location, of course.

14:59.000 --> 15:07.000
I developed a time-based state automaton to implement this scheduling, which is specified in Pac-Man dos.

15:07.000 --> 15:14.000
Again, so a sub-scalular.

15:14.000 --> 15:23.000
Then the AI part, I don't like to change the term AI because it's not reading AI.

15:23.000 --> 15:28.000
So, it's ghost instance, as its own targeting policy.

15:28.000 --> 15:34.000
There's a field in the entity data structure that defines the instance number.

15:34.000 --> 15:45.000
And based on that, we select a target and we invoke a navigation routine that targets this specific target.

15:45.000 --> 15:49.000
So, again, nothing fancy.

15:49.000 --> 15:57.000
In fourth, we tend to do simple things efficiently.

15:57.000 --> 16:07.000
Now, the C port, yeah, I targeted Linux first because it's seem to be the easiest one.

16:07.000 --> 16:12.000
But actually, I've got easier success with Solaris.

16:12.000 --> 16:15.000
So, yeah.

16:15.000 --> 16:20.000
If you care about portability, you care about politics, but it's expensive.

16:20.000 --> 16:28.000
If you want to have access to the standard document, you have to pay 700 bucks.

16:28.000 --> 16:29.000
Yeah.

16:29.000 --> 16:34.000
Or I could use my money in various ways, I suppose.

16:34.000 --> 16:44.000
The AI typically advocates open standards, which means that if you want the real thing, you will have to pay some serious money.

16:45.000 --> 16:52.000
Terminal control, you need that because by default, a terminal will echo anything.

16:52.000 --> 17:00.000
So, you need to turn it off and switch to row mode.

17:00.000 --> 17:10.000
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.

17:10.000 --> 17:11.000
Yeah.

17:11.000 --> 17:18.000
A few primitive off-worth keywords, the system depended.

17:18.000 --> 17:22.000
And this is where most of the porting effort was.

17:22.000 --> 17:24.000
The MS, yeah.

17:24.000 --> 17:28.000
You have to use poll and curses.

17:28.000 --> 17:34.000
So, as a result of all this, you get three time response.

17:34.000 --> 17:39.000
Really good stuff under my board and Solaris.

17:39.000 --> 17:47.000
The next is not so great, you have to wait a few seconds before input is taken into account.

17:47.000 --> 17:57.000
And the MS is a big disappointment because there's a bug in the sea runtime library that prevents me from handling input.

17:57.000 --> 18:08.000
So, I can upload the phone display the maze, but the first time the program queries the keyboard status, it crashes with the EIO.

18:08.000 --> 18:20.000
That is bad, but I guess I'll have to wait a month or two before the VSI fixes the problem.

18:20.000 --> 18:31.000
So, this was possible thanks to Jamie Peatman, Patman Dosier, VT100.net, a Bible.

18:31.000 --> 18:43.000
And of course, the good people at Teshnisha University's dean for the new forth conclusions.

18:43.000 --> 18:46.000
Fourth, it's really fantastic.

18:46.000 --> 18:51.000
You define your own concepts and you are the limit of the program.

18:51.000 --> 18:58.000
Specification requirements? Yes. They're useful if they're done for you, like it was the case here.

18:59.000 --> 19:02.000
You can benefit from that.

19:02.000 --> 19:07.000
Standard, I can't emphasize enough for the value of standards.

19:07.000 --> 19:12.000
Standards means portability, interoperability, interoperability.

19:12.000 --> 19:17.000
And this is a great, of course, free standards are better.

19:17.000 --> 19:26.000
And I think a really great developer develops his own tools to get to where E or she wants to be.

19:26.000 --> 19:29.000
And that's it.

