Videopac / Odyssey2 forum
September 23, 2021, 10:15:22 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: If you have some news and you want it to be shown here, pm Janzl!
 
   Home   Help Login Register links videopac.nl  
Pages: 1 2 [3] 4 5   Go Down
  Print  
Author Topic: Porting my SHOGUN game to the Videopac  (Read 2333 times)
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #30 on: May 25, 2021, 09:13:13 PM »

In the original game I used selfmodifying software to handle the AI from the computer.
Since the ROM can't be altered that same check is now done with a flag in RAM.

The first destination for a move is now reached. The evaluation of the move is the next to do. And then check it against best move.

Slowly getting the game ready.

Where I could code the entire game in 1K on a ZX81 it looks like I will need a bit more for the Videopac version. No problem since I have 2K ROM available without extra banks.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #31 on: May 30, 2021, 05:07:32 PM »

The AI of che computer plays all moves and then evaluates each move in a score. A higher score is a better move.
At this moment the best move before playing the actual move is found. This needed a different startscore on the Videopac than on the ZX81. Due to the 2-complement check I can't start with the value 0 as start since that will never give a carry when a chcek is done. The startvalue is set to 1.

I also passed over the 1K boundary and I still need to code extra checks, winner check and signaling an attack on the shogun.
So far it goes well, although coding 8048 is quite hard to do as a first game.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #32 on: June 05, 2021, 10:29:49 PM »

Arggghhhh,,,,

The compiler doesn't do a correct jump from 07FF to 0800. Must check it by hand.

Furthermore a bug in the computer AI. Somewhere a value is written to an address and I can see where.
No if the debugger could do a stop when writing to a certain address I could find the bug.
Now I am searching in the dark for several days already.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #33 on: June 06, 2021, 07:55:14 PM »

I hope you love to read the struggle I have coding my game.

For this game I needed a whole new routine to find endplaces and to handle the computer AI. It looked like the AI did not save 2 registers in the right way. I altered that and now I will slowly adapt the AI-routine in it again.
Logged
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2723



« Reply #34 on: June 07, 2021, 02:54:20 PM »

Of course, we love reading about game development. Wink
Logged
minodk
Attacked the Timelord
***
Posts: 160


« Reply #35 on: June 07, 2021, 04:51:37 PM »

What Rafael say…
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #36 on: June 13, 2021, 03:59:37 PM »

I can now show you the very first AI-move from the computer.
Thanks to the reply a few days ago I now have the display working and a small part of the AI.
For development the board is now not random so I can replay situations.
In this board I move my stone to a position where the best move would be to capture the stone
(which is just a small part of the AI) and the computer does that move.


https://www.mediafire.com/file/4azabzuw0l6wgsn/compai1.png/file
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #37 on: June 13, 2021, 08:55:27 PM »

Although my AI is not complete yet I played a game against the computer where more AI was added. I still need extra checks, endgame testing, signalling attacked, but it is getting somewhere. Small bugs repaired which occured in AI, R0 was corrupted on return in checkloop so it is set again. For playerloop R0 stayed ok, so no repairsetting was coded.

The checkloop is used by both, but the ai uses the enddestinations where the player only gets a valid field check.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #38 on: June 18, 2021, 05:43:13 PM »

The next step in the AI is the info after a move.
The info is still correct which means the temporary move is not working as it should.
That is the next thing to check.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #39 on: June 19, 2021, 06:28:35 PM »

Bugs are often just typo's.

Like MOVX A,@R0 had to be MOV A,R0

Now I need to add another save of 2 positions as well.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #40 on: June 21, 2021, 09:49:46 PM »

Debugging goes slowly, but another bug solved
Now the check on all positions on the board is working as it should.
Now I must check again why certain moves are not found as best move.

Slowly (too slow in my opinion) the game becomes as it should be.
When the AI is working as it should then I must add end of game checks and SHOGUN ATTACKED signalling.
Sound effects for selecting a stone is nice to hear what you did.
Finally 2 extra AI options will be added but those are extra.

It will fit 2K easily, but I am not ready yet.
1199 bytes at this moment.
 
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #41 on: June 27, 2021, 06:34:05 PM »

A bug in the AI solved which made me find another bug.
The board was not always resetted to the start of move.
After that the game became playable until an invalid move was done by the computer which lead to a crash of the game.

Now I need to find how this invalid move was selected. This part of the game is fully rewritten to make it fit for the Videopac
so I can check it with the original game.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #42 on: June 27, 2021, 06:41:19 PM »

I was able to make an invalid move by the player. This simplifies the search for the bug.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #43 on: June 27, 2021, 09:29:08 PM »

Bug found.... and another appeared..... and solved.

The game plays quite well although after many moves a display error appeared.
I think in a certain moment the VDC is written to and not ERAM.

Hope to find fixed steps to re0enact the error.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #44 on: June 29, 2021, 11:23:25 PM »

Yes…. Displaybug finally solved.
This might even be the cause of incidental crashes…. I hope it is.

if so I can work on the final steps of the game.
Logged
Pages: 1 2 [3] 4 5   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!