Jump to content

Photo

Classic99 versus Classic99 head to head turn based game DEMO

head to head classic99 tipi demo game

30 replies to this topic

#1 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Fri Jan 5, 2018 10:02 PM

EDIT1: - before reading all of this below, you can find Version two of the demo further down at this link - http://atariage.com/...demo/?p=3928868
I can confirm it works classic99 vs classic99 (over a network share) as well as classic99 vs Real Iron TI-99/4a equipped with TiPi.

EDIT2: Video of DEMO2 here: Classic 99 vs Classic99 and also Classic99 vs TI-99/4a TiPi Console



EDIT3: Slightly optimized code available HERE.

 

EDIT4: Latest and probably last version Number Guessing Console Vs Console Demo 2 v 3 (NGCVCD23) with updates and information can be found HERE.

Hi!

 

In chatting it up with the TiPi crew I decided to jump the gun and try something out. My basic understanding of TiPi is that it allows real iron consoles to use shared folders on a raspberry pi to use as DSKx. That's virtual disk drives on a network share. The team is hard at work to bring better capabilities and more options than I am going to demo here (when ever the video is done processing so I can upload it someplace. EDIT: WMV Video attached in this zip file = Attached File  ngcvc-1.zip   28.87MB   5 downloads(NO AUDIO - Something went wrong - but video yes). But I thought, well, classic99 can use network shares as well. Now this demo is not using network shares but it easily can.

For simplicity this is what I did.

DISCLAIMER: My code is ugly and not optimized at all - if you destroy planet earth running it, I deny any responsibility, use at your own risk.
It's just a demo after all to illustrate where my ideas are in turn based head to head gaming we can all enjoy in emulation right now. And on Real Iron once TiPi becomes available sometime in the next year or two (hey, I'm not putting any undue pressure on these guys, I think it'll be out sooner that  but i also don't want to make enemies of them). Anyway - 

I created a simple number guessing game that you run in two different classic99 sessions. For the time being I used a local folder but it can easily be done with a shared network folder on two different computers. But for simplicity, do this:

 

Step 1: Create a folder on your computer.

Step 2: Download the attached ngcvc XB file (Number Game Console Vs Console) and save it in that folder you created in step 1.

Step 3: Open a classic99 TI-99/4a v1 emulation session and point DSK1 to the file in the folder using FIAD.

Step 4: Open another classic 99 emulation session just like before (while leaving the other up and running) and make suere DSK1 is configured to look at the same file/folder using FIAD.

Step 5: place the two screens side by side and resize as needed.

Step 6: Type the following line on one screen then press enter.           OLD DSK1.NGCVC

Step 7: Once the game asks if you are player 1 or not (DO NOT ANSWER YET) - repeat step 6 on the other screen.

Step 8: Decide which one will be player 1 and type Y then hit enter. On the player 2 side type N and hit enter. Don't forget you have to click on the appropriate screen to activate it.

Step 9: play the game going back and forth between screens.

If you want, try it over your LAN making sure both computers running classic99 are configured for the same exact DSK1 location (a shared folder someplace) and give it a go.

 

THIS IS ONLY A DEMO: What I'm doing is creating a file with only a single record in each file. There are 6 files altogether. They contain the only information that needs to be shared between the console and they are access via Disk IO functions. I think this is a pretty good way to make simple turn based head to head games NOW via classic99 and more robust games later using TiPi and better functions that may or may not be implemented. (see disclaimer and fill in the blanks)

 

Here is the DEMO: Attached File  NGCVC.zip   1.87KB   3 downloads

Here is the Original buggy Source Code:

Spoiler

 

 

...


Edited by Sinphaltimus, Mon Jan 29, 2018 2:57 PM.


#2 OLD CS1 OFFLINE  

OLD CS1

    Technomancer

  • 5,781 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Fri Jan 5, 2018 10:40 PM

Interesting.



#3 Schmitzi OFFLINE  

Schmitzi

    River Patroller

  • 4,402 posts
  • ToXiC
  • Location:Germany

Posted Sat Jan 6, 2018 4:03 AM

cool.  This, and ONE central "network drive",  for all of us,  and for all new network-enabled proggies,  somewhere on the web ;) :lust:



#4 BeeryMiller ONLINE  

BeeryMiller

    Dragonstomper

  • 729 posts
  • Location:Campbellsburg, KY

Posted Sat Jan 6, 2018 5:35 AM

Ah, be careful.

​Remember what was said earlier on another topic.  TIPI is somehow loading an image of the file and if two different users are trying to access the same file simultaneously, things will go to crap.  This may be able to be resolved writing some kind of filename.bsy files so only one person can have the file open at a time.

 

But yes, I think you have a good idea.  I think the more we float these kinds of ideas out there, the more ideas get generated about new possibilities of use for the TIPI project.

​Beery



#5 Schmitzi OFFLINE  

Schmitzi

    River Patroller

  • 4,402 posts
  • ToXiC
  • Location:Germany

Posted Sat Jan 6, 2018 6:01 AM

So maybe we just can just establish a private "Unique Config File" per User and per App on that web-driven DSK,

in the format like "#AppId #UserId" (IDs have to be managed/negotiated once),

so that every User/App can store any conditon/data in its own file, that other users (or the "server", see below) can read/write/use later.

 

Also, maybe another unique "Central Config File", one for each App could exist, to store common things (HighScores, saved games....)

 

For exclusive Read/Write-access, an App could be programmed in that way,

that it first checks if a (central or user) control file exists (R/W request), what would mean "file is in use",

so that it just has to wait for re-check (or do other things or write a temp file to be nerged by the server later..)

If "free" (controlfile does not exist), the app could (temporarily) generate a control file (to prevent from other users access at this moment),

and then read/write to the wanted data file inside the DSK, and then to delete the control file (release data file for next user)

 

In addition, a "24/7-TI-99-Server" with a special App to manage/maintain these files, could check for orphaned files or whatever,

or, if you store personal highscores in the user-file only, to merge that data into the central file.

 

Or something like this ?  :)



#6 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Jan 6, 2018 6:01 AM

And it's under 4k lol (4kgame code contest)

#7 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Jan 6, 2018 7:04 AM

So maybe we just can just establish a private "Unique Config File" per User and per App on that web-driven DSK,

in the format like "#AppId #UserId" (IDs have to be managed/negotiated once),

so that every User/App can store any conditon/data in its own file, that other users (or the "server", see below) can read/write/use later.

 

Also, maybe another unique "Central Config File", one for each App could exist, to store common things (HighScores, saved games....)

 

For exclusive Read/Write-access, an App could be programmed in that way,

that it first checks if a (central or user) control file exists (R/W request), what would mean "file is in use",

so that it just has to wait for re-check (or do other things or write a temp file to be nerged by the server later..)

If "free" (controlfile does not exist), the app could (temporarily) generate a control file (to prevent from other users access at this moment),

and then read/write to the wanted data file inside the DSK, and then to delete the control file (release data file for next user)

 

In addition, a "24/7-TI-99-Server" with a special App to manage/maintain these files, could check for orphaned files or whatever,

or, if you store personal highscores in the user-file only, to merge that data into the central file.

 

Or something like this ?  :)


I can tell you that one of the developer's is working on a solution (currently in alpha) to handle such server side requests.  



#8 Schmitzi OFFLINE  

Schmitzi

    River Patroller

  • 4,402 posts
  • ToXiC
  • Location:Germany

Posted Sat Jan 6, 2018 7:09 AM

super :lust:



#9 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Jan 6, 2018 7:32 AM

Ah, be careful.

​Remember what was said earlier on another topic.  TIPI is somehow loading an image of the file and if two different users are trying to access the same file simultaneously, things will go to crap.  This may be able to be resolved writing some kind of filename.bsy files so only one person can have the file open at a time.

 

But yes, I think you have a good idea.  I think the more we float these kinds of ideas out there, the more ideas get generated about new possibilities of use for the TIPI project.

​Beery

I've been notified by my handlers that I have successfully completed my NDA obligations and can now publicly state that I have been part of the TiPi beta as of December 3rd when it arrived at my location. 

The DEMO I posted is the first step towards me working out a simple way for the basic hobbyist to take advantage of TiPi's most basic features. It is not in and of itself TiPi ready. I have tried using this DEMO as-is with classic99 using the TiPi samba share and I ran into many issues which i was warned about and learned about beforehand. Mainly being exactly what you posted - random write protect errors, random attempting to read past end of file errors, etc... So without a doubt, this game demo as is will not work with TiPi.

My next step is to make it work with TiPi this weekend if I can. And I definitely want to use a similar method as has been mentioned by creating a "filebusy" file to help play traffic cop with the disk IO read/writes. Using On Error (thanks Casey) I can  do something like Open a file, if this file doesn't exist (On error) then go ahead and open that other file instead. If i can open the file in question (it does exist) then close it and do not attempt to do any disk functions to that other file yet.

It's very tricky because no two console are the same, you can't really sync them up via file IO and adding a sort of Delay loop might work, for a time. I would still have to contend with one console checking to see if the file exists (and it does for a millisecond) but the other console tries to delete it at the same time. There isn't any kind of RETRY function that I know of for errors. So possibly some creative use of the ON ERROR function (Thank you again Casey).

I think the biggest point I wanted to make here is - has anyone else ever done this in emulation? Surely there are many users here who love and use their TI emulation to develop and play but do not actually own a real console at all. Why aren't we flooded with Emulation Console vs emulation console turn based games today after all these years? So with or without TiPi and a real console, we really can start making games in this way. I already have a head to head submarine hunt game I want to make using this method. (A dumbed down version of battleship). I can't wrap my head around it just yet but theoretically the number of players is endless. But more grounded in reality; something like 4 player card games could be made. I'm sticking with 2 player games for now and working more towards TiPi compatible games. But the initial version of these games will be classic99 vs classic99 (CvC) games first and then have a TiPi compatible version made by adding in whatever extra code I have to if only to handle IO timing, and lucky for me CvC works not matter how you cut it (c99 vs c99, c99 vs console, console vs console) :)

So later today I will prove out this game over a network share instead of a local file using classic99 and then I will start on the TiPi stuff. I want to make sure there isn't any TCP/IP latency or file share permission thing going on in windows that might generate some of the same errors I witnessed trying to use the TiPi samba share.
 



#10 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Jan 6, 2018 2:29 PM

Ok so trying this over a network share (Windows) using just classic99 vs classic99 and I was getting a lot of IO errors (just like when I tried the samba shares on the Pi from from windows).

So I added ON ERROR checks at every OPEN statement. There is a performance hit but NO MORE *GAME STOPPING* ERRORS!

So this version here will work (and perform better) on a local drive and will work (less performance) over a network share (classic99):
Source code included in TXT file within zip, follow the same instructions as in the original post except for the shared folder location.
 

Attached File  NumberGame_cVc_DEMO2.zip   3.67KB   6 downloads


Edited by Sinphaltimus, Sat Jan 6, 2018 3:30 PM.


#11 Schmitzi OFFLINE  

Schmitzi

    River Patroller

  • 4,402 posts
  • ToXiC
  • Location:Germany

Posted Sat Jan 6, 2018 3:06 PM

Great !!

 

This error  is a timout, maybe



#12 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Jan 6, 2018 6:27 PM

I just tested via the latest TiPi beta release (Thanks M@) and it works as is.

I can confirm it works classic99 vs classic99 (over a network share) as well as classic99 vs Real Iron TI-99/4a equipped with TiPi.



#13 OLD CS1 OFFLINE  

OLD CS1

    Technomancer

  • 5,781 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sat Jan 6, 2018 7:57 PM

Is it detecting when the files are open?  If so, that precludes my idea of a lock file.



#14 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Jan 6, 2018 9:17 PM

It does error but I just tell it to retry until there's no error using ON ERROR.

The full nicely formatted tidbit source is in the zip of demo2.

I'm going to make another game demo, a bit more fun than number guessing using this same method.

#15 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sun Jan 7, 2018 6:48 PM

Updated original post with this video:



#16 Schmitzi OFFLINE  

Schmitzi

    River Patroller

  • 4,402 posts
  • ToXiC
  • Location:Germany

Posted Sun Jan 7, 2018 7:50 PM

Hell yeah !! :lust:



#17 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Jan 8, 2018 9:09 AM

So, JediM@42 suggested trying this with dropbox. So i did. I shared my TiPi folder in my personal dropbox with my work dropbox and successfully played the number guessing game between two classic99 session on two different computers over the internet. IT WORKS!

Multiplayer turn based gaming is possible (and has been for a while) over the internet today! GET DEVELOPING FOLKS!!!!

Obviously - you can only share your folder with your opponent so it's not elegant. You'd have to share the folder with anyone you'd want to play with and they would obviously need a dropbox account. But it can be done. I've done it and will have a video later on if not sometime during the week demonstrating that.



#18 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Jan 8, 2018 10:14 AM

Here is a video demonstrating the number guessing game being played over the internet using classic99 and dropbox - Again, sorry no audio. I don't know what's up with ShadowPlay when recording desktop. I'll fix eventually and probably do a recording using my GoPro before the end of the week. But for now - there is this: Attached File  DropBox.zip   46MB   7 downloads

 

Also, take note of the dropbox notifications popping up during gameplay. *not faked* - LOL :) 



#19 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Jan 8, 2018 12:00 PM

So I optimized the Number Guessing game a little bit - and there is a performance boost obviously.

I added the delete file functions at the beginning of the code as I was trouble shooting issues, I also had RESTORE lines for every Disk IO function, as part of a misunderstanding.

Thanks to Tursi for letting me know that DELETE isn't supported (doesn't actually delete) when DSK1 is configured as FIAD in classic99.
And to M@ for letting me know that RESTORE is not needed unless I'm using APPEND in the OPEN statement.

I left all of these lines in the SOURCE code and just commented them out in TidBit so they are not transferred to the XB code when translated via TidBit.

Tested, still works as intended....

Get Source, XB program in TXT and ready to run XB program here:Attached File  NumberGuesscVcDEMO2v2.zip   5KB   5 downloads



#20 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Jan 8, 2018 1:39 PM

I'm not certain how those work but if you just point them to a directory to use as DSK1 then it should work fine. The program itself (number game) takes care of the error checking for access to the file(s).

But, with emulation, it's not TiPi related - I answer your question from the TiPi topic here (http://atariage.com/...ment/?p=3930351)


Beery Miller Wrote:

Sounds great.

 

"I would assume this would NOT work for something like MAME or MESS since I do not think two different emulators could access the same file at the same time???

 

Beery"

Sounds great.

 

I would assume this would NOT work for something like MAME or MESS since I do not think two different emulators could access the same file at the same time???

 

Beery



#21 mizapf ONLINE  

mizapf

    River Patroller

  • 3,420 posts
  • Location:Germany

Posted Mon Jan 8, 2018 2:53 PM

I already answered in the other thread. Keep in mind that disk image processing is a significant feature of the emulation in MAME, so MAME cannot see files on the host as done in Classic 99. You cannot point MAME to single files or directories on the host. Moreover, all changes within dsk image files happen in memory and are committed to the host file system when you exit the emulation.

#22 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,515 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Jan 8, 2018 2:59 PM

I already answered in the other thread. Keep in mind that disk image processing is a significant feature of the emulation in MAME, so MAME cannot see files on the host as done in Classic 99. You cannot point MAME to single files or directories on the host. Moreover, all changes within dsk image files happen in memory and are committed to the host file system when you exit the emulation.

Ah, I had no idea. so I guess this doesn't work with MAME. Thanks for answering.

I should probably add - "Works with Emulators that support FIAD" only.


Edited by Sinphaltimus, Mon Jan 8, 2018 3:00 PM.


#23 Schmitzi OFFLINE  

Schmitzi

    River Patroller

  • 4,402 posts
  • ToXiC
  • Location:Germany

Posted Mon Jan 8, 2018 4:46 PM

I already answered in the other thread. Keep in mind that disk image processing is a significant feature of the emulation in MAME, so MAME cannot see files on the host as done in Classic 99. You cannot point MAME to single files or directories on the host. Moreover, all changes within dsk image files happen in memory and are committed to the host file system when you exit the emulation.

 

hmmm, maybe one can "flush" that on demand, with a special trick or so ? (without exiting the Mame)



#24 mizapf ONLINE  

mizapf

    River Patroller

  • 3,420 posts
  • Location:Germany

Posted Mon Jan 8, 2018 5:37 PM

hmmm, maybe one can "flush" that on demand, with a special trick or so ? (without exiting the Mame)

 

I could elaborate with quite some lines on that, but for now suffice it to say: I guess you don't want to think about questions like how to trigger a flush, how to detect an external change that requires a refresh, and foremost: How to work with a single image file that may be changed at different locations, possibly by different agents. ;)



#25 BeeryMiller ONLINE  

BeeryMiller

    Dragonstomper

  • 729 posts
  • Location:Campbellsburg, KY

Posted Tue Jan 9, 2018 8:43 AM

I already answered in the other thread. Keep in mind that disk image processing is a significant feature of the emulation in MAME, so MAME cannot see files on the host as done in Classic 99. You cannot point MAME to single files or directories on the host. Moreover, all changes within dsk image files happen in memory and are committed to the host file system when you exit the emulation.

 

Really?  When you exit the emulation?  What happens to the changes on the DSK or HD image if the emulation crashes and you have to reboot the whole computer or have to do a Windows CTRL-ALT-DELETE to end the task?  I would have swore those changes were committed to the original files?  

 

Beery







Also tagged with one or more of these keywords: head to head, classic99, tipi, demo, game

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users