Prime retro-gaming: trek!
|
08-27-2024, 12:16 AM
Post: #1
|
|||
|
|||
Prime retro-gaming: trek!
I converted the 1973 trek to python to put it on the Prime: :-D
https://udel.edu/~mm/hp/trek/ Not exactly what a calculator is intended for, I suppose, but fun. And a question, too, is there a way to use fixed width font on the Prime? The old game assumes it, and I had to hack at it a bit to somewhat line up things with variable width font. Printing a tab (\t) character results in a rectangle and not an actual tab, which would be an easy solution to lining up text. Thanks, Mike |
|||
08-28-2024, 07:57 PM
(This post was last modified: 08-28-2024 07:57 PM by komame.)
Post: #2
|
|||
|
|||
RE: Prime retro-gaming: trek!
(08-27-2024 12:16 AM)ab3ap Wrote: I converted the 1973 trek to python to put it on the Prime: :-DA very good port of the game! (08-27-2024 12:16 AM)ab3ap Wrote: Not exactly what a calculator is intended for, I suppose, but fun.Well, the HP Prime is a real computer, and computers can be used for many different things. (08-27-2024 12:16 AM)ab3ap Wrote: And a question, too, is there a way to use fixed width font on the Prime? The old game assumes it, and I had to hack at it a bit to somewhat line up things with variable width font. Printing a tab (\t) character results in a rectangle and not an actual tab, which would be an easy solution to lining up text. There is no support for monospaced fonts (for now), but you can easily create such a terminal yourself, including support for \t and custom font types. To do this, you need to use graphic commands from the hpprime module. By the way, it would be useful to have some advanced graphics library for Python that allows efficient access to the graphic frame buffer. As for the monospaced font terminal, I'll try to write it, and it shouldn't be too difficult (read: I'll share it soon). All the best! Piotr Kowalewski |
|||
08-29-2024, 03:11 PM
Post: #3
|
|||
|
|||
RE: Prime retro-gaming: trek!
In addition to Piotr's comment, I'd like to add this teaser. Simply copy the code to the Python app. It doesn't do fancy things, but shows how things could be displayed --- the Prime is a graphing calculator after all.
Code: import hpprime as hp Hope you're addicted. Günter |
|||
08-29-2024, 04:53 PM
Post: #4
|
|||
|
|||
RE: Prime retro-gaming: trek!
(08-28-2024 07:57 PM)komame Wrote:Thank you, Piotr! My goal was to minimize change in look or game play. I had to move text next to short range scan to make it fit, and some other little things. Otherwise, it looks very much as it originally did.(08-27-2024 12:16 AM)ab3ap Wrote: I converted the 1973 trek to python to put it on the Prime: :-DA very good port of the game! (08-28-2024 07:57 PM)komame Wrote: As for the monospaced font terminal, I'll try to write it, and it shouldn't be too difficult (read: I'll share it soon).I look forward to it, thanks! Mike Markowski |
|||
08-29-2024, 04:59 PM
Post: #5
|
|||
|
|||
RE: Prime retro-gaming: trek!
(08-29-2024 03:11 PM)Guenter Schink Wrote: In addition to Piotr's comment, I'd like to add this teaser. Thanks for that, Günter, you have me thinking now... My goal originally was the 1970s look and feel for nostalgia. But it has simple internals and might be fun to put a new "face" on the game and capitalize on what the Prime can do! Mike Markowski |
|||
08-30-2024, 12:58 AM
(This post was last modified: 08-30-2024 12:59 AM by jte.)
Post: #6
|
|||
|
|||
RE: Prime retro-gaming: trek!
Seeing this certainly brightened my day. After seeing it, I had to show my daughter some other ports of trek. (I have definite memories of playing a C64 port of the game; I don't immediately remember playing it on my ZX81.)
In the past, for this sort of thing, and for other games from the 8-bit era of home computers / early consoles, I was thinking what could be nice would be to add a PPL graphics command to get a convenient / quick analog to "character graphics" of the 70s / 80s: the PPL command would take a two-dimensional array (matrix?) of character indices, a grob (of character graphics / a font / a "sprite sheet") + stride information, and a destination graphical anchor point. Running the command would blit a rectangle of the grob onto the destination for each entry in the array (the rectangle taken being determined by the character from the array and the stride information). (Of course, if the sprite sheet were a more typical font — "A" for 65 etc., a regularly spaced terminal could be drawn with one PPL command as well.) Another possibility would be to have a grob being used for the "character framebuffer". (So a single pixel in that grob would determine the rectangle taken, rather than an integer.) A string is another possibility. (Each has advantages; perhaps they should all be allowed. A string as source would involve a slightly different rendering approach on the back end.) |
|||
08-30-2024, 01:08 AM
Post: #7
|
|||
|
|||
RE: Prime retro-gaming: trek!
(08-29-2024 04:53 PM)ab3ap Wrote:(08-28-2024 07:57 PM)komame Wrote: A very good port of the game!Thank you, Piotr! My goal was to minimize change in look or game play. I had to move text next to short range scan to make it fit, and some other little things. Otherwise, it looks very much as it originally did. I'll second that. Me too! Hmmm... now I'm wanting to play trek. Thanks again, Mike, for porting & posting. |
|||
08-30-2024, 08:37 AM
Post: #8
|
|||
|
|||
RE: Prime retro-gaming: trek!
That looks great, thanks for helping keep the Prime alive :-).
|
|||
08-30-2024, 08:49 PM
Post: #9
|
|||
|
|||
RE: Prime retro-gaming: trek!
(08-30-2024 12:58 AM)jte Wrote: ...the PPL command would take a two-dimensional array (matrix?) of character indices, a grob (of character graphics / a font / a "sprite sheet") + stride information, and a destination graphical anchor point...What a cool idea and probably more time consuming (to create char graphics) than difficult. How ironic, the modern lengths we'll go to to recreate that retro feel! Mike |
|||
08-30-2024, 08:59 PM
Post: #10
|
|||
|
|||
RE: Prime retro-gaming: trek!
(08-30-2024 08:37 AM)matalog Wrote: That looks great, thanks for helping keep the Prime alive :-).You're welcome, matalog, it was a fun diversion. I also added an unadvertised 'm' (for map) command. It's updated every time you do a short or long range scan. To play on the calculator, I feel that self-contained record keeping is helpful to better enjoy the game. Or, ignore its presence for 70s experience! -Mike Markowski |
|||
08-30-2024, 10:34 PM
(This post was last modified: 08-30-2024 10:58 PM by komame.)
Post: #11
|
|||
|
|||
RE: Prime retro-gaming: trek!
The beta version of the terminal is ready.
Most features are operational, including: - text display with screen scrolling support (surprisingly, it works remarkably fast!) - tab (\t) support (configurable size upon terminal creation) - setting the cursor at any position on the screen (x,y) - light and dark mode - clearing the terminal - input mode Regarding the input mode, it currently works at a basic level, meaning it displays a prompt and allows entering text or numbers. It supports Backspace and Clear for erasing entered text. Currently, toggling the Alpha and Shift modifiers works in a somewhat limited manner, as the first press activates the modifier and the second deactivates it. There is no support yet for single-use. Of course, I intend to refine this. While playing Trek, I realized that it would be useful to have a feature in 'input' that initially sets the Alpha and Shift modifiers according to the type of data being entered. For example, when a command is issued, the Alpha modifier should be active immediately, and when a numerical value is being entered, no modifiers should be active. This terminal has such a capability (as an optional parameter to the 'input' function). I also plan to add support for diacritical characters and buffering so that the content of any part of the terminal can be read. I have other ideas, but more on that later... I will prepare a short documentation and share the source code tomorrow. (08-30-2024 12:58 AM)jte Wrote: I have definite memories of playing a C64 port of the game [...] I had exactly the same idea when I promised to write this terminal. I created a bitmap with a graphic presentation of each character in sequence (all in one line next to each other) and I copy rectangles depending on the given character (after converting it to its numerical value, which are then treated as indices for rightward shifting to select the correct rectangle). The font I used comes from an 8-bit Atari. That was my first computer back in the 80s... Piotr Kowalewski |
|||
08-31-2024, 08:59 PM
(This post was last modified: 08-31-2024 09:38 PM by komame.)
Post: #12
|
|||
|
|||
RE: Prime retro-gaming: trek!
Hi, Mike!
I've adjusted your (port of) game to use my terminal (tml module). Trek_tml.hpappdir.zip (Size: 12.02 KB / Downloads: 11) With the current font, tml can display 30 lines of 40 characters each on the screen. However, I see that this game requires a screen with more characters per line. For now, I've added extra newline characters '\n' in some texts to make long texts look sensible. Tomorrow, I will try to apply a different font that can display 64 characters per line. Terminal initialization looks like this: Code: tr = tml(dark_mode = False, tab_size = 8) An optional tab_size parameter defines the size of the tabulator. If not specified, the default size is set to 4. See how much this has simplified the damageRpt() function. When issuing commands, do not press Alpha; instead, directly press the key with the appropriate letter (the Alpha modifier is automatically activated for commands). Currently, there is no display of the active modifiers' status, so it is unknown which ones are active at any given time (I plan to address this in the coming days). However, for the purposes of this game, that is entirely sufficient, as there is no need to use them since they activate automatically. I was initially going to prepare the documentation first, but I decided that adjusting the game would be more interesting, so I tackled that first. I will share the documentation tomorrow as soon as I finish it. The 'tml' project is still in the beta phase. Piotr Kowalewski |
|||
09-01-2024, 01:55 AM
Post: #13
|
|||
|
|||
RE: Prime retro-gaming: trek!
It seems that there is a bug in your port in the warp() function.
When you try to cross the edge of the galaxy, it starts displaying negative sector coordinates. Piotr Kowalewski |
|||
09-01-2024, 08:54 PM
Post: #14
|
|||
|
|||
RE: Prime retro-gaming: trek!
(08-31-2024 08:59 PM)komame Wrote: Hi, Mike! Thank you, Piotr, this is exciting to see! I'm unable to look at it till tomorrow, but can't wait. I also converted STTR1 - the original trek - which is a little better and has a couple more functions. However, it's short range scan is harder to read. It will also greatly benefit from your terminal and then I'll share that, too. Thanks! Mike |
|||
09-02-2024, 04:43 PM
(This post was last modified: 09-02-2024 04:48 PM by komame.)
Post: #15
|
|||
|
|||
RE: Prime retro-gaming: trek!
This is what it looks like when using the 8x8 font (8-bit Atari style) - 40 characters in a row:
And this is what it looks like in dark mode when using the 5x10 font (my design), which allows for 64 characters in a row: I was thinking that such a terminal offers tremendous possibilities. For instance, one could create a windowing system, something like Turbo Vision (a library from the 90s that worked with Turbo Pascal, displaying windows in text mode with the ability to scale, move, etc.). You could also make your own text editor (including a Python script editor) with options to choose the type of font, etc. @Mike, let me know your first impression If you're using an emulator on a PC, remember not to use a physical keyboard. On the emulator, only the on-screen keyboard will work (at least for letters, as numbers should function). It's best to use this on a physical HP Prime. Piotr Kowalewski |
|||
09-02-2024, 08:17 PM
Post: #16
|
|||
|
|||
RE: Prime retro-gaming: trek!
(09-02-2024 04:43 PM)komame Wrote: This is what it looks like when using the 8x8 font (8-bit Atari style) - 40 characters in a row: It's fantastic, Piotr, thanks for sharing your hard work! It really does offer many possibilities. Prime programming is not so different from 1980s programming in some ways. Is your 5x10 font also available? It looks very nice and STTR1 is wider than trek. Hopefully, the smaller font will shrink things down enough. If not, I'll modify output to fit. I'll copy your tml changes into my debugged Trek app and share it soon. Thanks again, really nice work! -Mike |
|||
09-02-2024, 10:36 PM
(This post was last modified: 09-02-2024 10:36 PM by komame.)
Post: #17
|
|||
|
|||
RE: Prime retro-gaming: trek!
(09-02-2024 08:17 PM)ab3ap Wrote: It's fantastic, Piotr, thanks for sharing your hard work! Thanks! When I saw the final result, it immediately reminded me of the good old days when I was programming my first games in BASIC on Atari. When I was in high school, I wrote an economic game (in C++) that took place several centuries ago. As the ruler of villages, you had to care for your subjects, farmlands, mills, defend against invaders, and at the same time multiply your wealth (without going bankrupt), despite many obstacles that fate threw your way. It was possible to play with several people (I think up to 4), including attacking each other for robbery This game spread throughout the whole school in the blink of an eye. Later, I graduated from that school and returned for a visit after about 3 years. I was incredibly happy when, upon entering the computer room, I saw my game on several screens! It was still there, they were still playing it. A wonderful feeling... Everything was in text mode. Unfortunately, I don't have the source code. It got lost over all these years. (09-02-2024 08:17 PM)ab3ap Wrote: It really does offer many possibilities. Prime programming is not so different from 1980s programming in some ways. That's right! With the option to set the cursor anywhere on the screen using the set_cursor(x,y) method, you can even create animated games in text mode, like 'PONG' or even more complex ones like 'Breakout' or 'Labyrinth'. I've noticed that just filling the screen with text content is incredibly fast, so if you prevent the screen from scrolling, you can really get a lot out of it. Besides, scrolling the screen is also very fast, definitely faster than in the factory terminal of HP Prime, and I think it would be even faster if I used a larger font (for now I am playing with very small ones). It seems that the 'tml' module is the foundation for giving old text games and programs new life on the HP Prime (09-02-2024 08:17 PM)ab3ap Wrote: Is your 5x10 font also available? It looks very nice and STTR1 is wider than trek. [...] Of course, it is available, and another one is on the way, this time a bit larger. Attached you will find Trek with a slightly newer version of 'tml' (still in beta) featuring the 5x10 font. (09-02-2024 08:17 PM)ab3ap Wrote: Thanks again, really nice work! And thank you for the kind comments and appreciation of my work. I really am eager to develop this solution further, and I have many ideas for its development. All the best! Piotr Kowalewski |
|||
09-03-2024, 01:08 PM
Post: #18
|
|||
|
|||
RE: Prime retro-gaming: trek!
(09-02-2024 10:36 PM)komame Wrote: I was incredibly happy when, upon entering the computer room, I saw my game on several screens! It was still there, they were still playing it. A wonderful feeling... Everything was in text mode. Unfortunately, I don't have the source code. It got lost over all these years.That's too bad, that would be great to revisit your early effort. (09-02-2024 10:36 PM)komame Wrote: It seems that the 'tml' module is the foundation for giving old text games and programs new life on the HP PrimeIt is a more generally useful piece of software than porting trek. (09-02-2024 08:17 PM)ab3ap Wrote: Is your 5x10 font also available? It looks very nice and STTR1 is wider than trek. [...] (09-02-2024 10:36 PM)komame Wrote: Of course, it is available, and another one is on the way, this time a bit larger. Attached you will find Trek with a slightly newer version of 'tml' (still in beta) featuring the 5x10 font.Thanks! I used tml with STTR1 (1972 Star Trek) and the smaller font allows sttr1 output to fit on the Prime screen without modifying output formatting. It can be downloaded from my Star Trek page, and I will update the page after work to describe the sttr1/tml combination. Mike Markowski |
|||
09-06-2024, 01:10 AM
(This post was last modified: 09-06-2024 06:13 PM by ab3ap.)
Post: #19
|
|||
|
|||
RE: Prime retro-gaming: trek!
(09-01-2024 01:55 AM)komame Wrote: It seems that there is a bug in your port in the warp() function. Thank you, Piotr. I fixed the bug last night (I think!) and then uploaded a wrong and broken version. Apologies to anyone who might have downloaded that. I've played a few games and tried some crazy warping and all seems well now. But please let me know if other strange behavior appears. The correct versions have been uploaded today. Thanks, Mike |
|||
09-26-2024, 02:01 PM
Post: #20
|
|||
|
|||
RE: Prime retro-gaming: trek!
Hi Mike,
I asked in another thread what the best HP calculator to experiment with writing some astronomy software on would be. The work that you've done here and Piotr's excellent terminal module have convinced me that a mixture of PPL and Python on the Prime forms an interesting development platform to pursue, and writing computational code in Python allows at least a modicum of cross-platform compatibility. I've never used Python, but looking at your code it doesn't seem too dissimilar to the C and C++ languages that I am familiar with, and I'm sure I can find some online tutorial resources to get me going. Thank you for the inspiration! Chris |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)