Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: boot2490 on September 17, 2011, 03:51:12 pm

Title: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 17, 2011, 03:51:12 pm
So, you are smart, and finish the BST (Big Standardized Test) at your school with like forty minutes left. You are bored. You aren't in the mood for reading, and definitely not in the mood for the same old calculator game.
How about a round at Pebble Beach? Taking a few swings at the driving range to improve your aim? Playing the Masters with Tiger?

I am planning a golf game in TI BASIC, for ease, or AXE, for the grayscale. I am currently planning. Suggestions, comments, and help is welcome.

Until this can get its own section (like ones in major community projects) Updates will be posted here.

I could also make a level editor due to the flexibility of the program to matrix format.

All ideas and progress is listed below IN THE IDEAS POST.

Happy lazy golfing!
Title: This is the update post! All updates and ideas will go here until further notice
Post by: boot2490 on September 17, 2011, 04:05:00 pm
Updates:
Started working on 9-18-2011


Ideas: PLEASE GIVE FEEDBACK?

Idea 1: Structure:

Currently the Basic style psuedocode structure is planned like so:
Spoiler For Spoiler:
Code: [Select]
Run program which stores the 15*23 level into a matrix
While 1
Menu (view map, change club, swing, save, load, quit)
Lbl view map
Loop: check matrix bit by bit, return each value
If value = 1
draw grass 4x4 sprite
If value = 2
draw rough 4x4 sprite
If value = 3 and so on
End
Lbl Change club
Menu (Driver: 1->Z    5->Distance,  Iron: 2->Z    4->Distance,  Wedge:3->Z    2->Distance,  Putter: 0->Z    1->Distance)
Lbl Swing
Draw thermometer
Loop: expand line to match swing power like a normal power bar
If max set variable to down
Loop: Shrink line accordingly
If line reaches bottom, go back to menu
If 2nd pressed
Start new line below first, Going down towards accuracy mark
Test accuracy variable with closeness of line to mark
If 2nd pressed, send variables to shot calculation program
Lbl Save
Save all variables such as position, club, hole, level pack to list
Lbl Load
Load variables from list
Lbl Quit
Goto Lbl Z
Lbl Shot Calculate
Use trig, wind value vs z value, and matrix data to calculate new position
End
Lbl Z
Output "Thanks for playing!
Output (block done token)

Wow it feels good to write that all down.

Idea 2: Structure Idea 2

The releases will be interesting.
I will release each part of the engine written in BASIC and then I will release select parts (such as the level renderer) in AXE with source as well.
That way, You can download individual parts of the engine, or the whole thing, to customize your experience.

Idea 3: Level expansion

I have several ideas here:
1. LEVEL EDITOR
2. some courses to make with it:

Please give suggestions for ANYTHING in the form of a reply.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 17, 2011, 07:09:24 pm
Cool!

Would you mind if, after you finish it, I convert it to Casio Basic? I'll give you all the programming credit, and then just have a little foot note saying I converted it.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 17, 2011, 07:28:36 pm
Most certainly!! I am glad to help in the battle against boredom.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 17, 2011, 07:34:16 pm
LOL. We dont have axe in the casio community, and I don't really know C very well, so i'll probably do it in lua or BASIC. Probably BASIC.

And i'm all for something entertaining to do during stand. tests! I was always at least 50 min. ahead. And then you have some kid that still isn't finished at the end of the outrageous time limit. D:
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 17, 2011, 07:48:04 pm
Sometimes *that kid* spends another hour or two in the library makeup period still doing the test. That's like three hours.

You are free to fill in the posted code structure with actual CASIO basic if you wish.
Anyway, It will be BASIC with a basic renderer, And it will have an optional AXE renderer. How does that sound?
What are some really good/famous golf courses I could include? I have a few ideas:
Pebble Beach
Wii Sports's golf course
Something from Mario Golf
Wailee Country Club
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 17, 2011, 08:11:36 pm
sounds great.

How about St. Andrew's?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 17, 2011, 08:55:16 pm
Never heard of it.
I'll look it up right now.
I want to give an homage to Pittsburgh, too...


If anyone wants to use the posted code structure for there own golf game, /me points to flyingphisch and his CASIO
 i will be MORE than glad. It is a lacking genre on the calc. Just don't make it too much better than mine ;)
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 17, 2011, 10:03:53 pm
Quote
If anyone wants to use the posted code structure for there own golf game,
* boot2490 points to flyingphisch and his CASIO
 i will be MORE than glad. It is a lacking genre on the calc. Just don't make it too much better than mine

I can't. LOL.

St. Andrew's is in scotland, I believe, and is probably the most famous or one of the most famous golf courses of all time. According to legend, that's the area where golf originated, and St. Andrew's is arguably the hardest golf course in the world.

*flyingFisch is done teaching history (note the F, not ph)

Please do not take anything in this post personally. ;)

Casio code:
Spoiler For Spoiler:
Code: [Select]
'Run program which stores the 15*23 level into a matrix
While 1
Menu (view map,1,change club,2,swing,3,save,4,load,5,quit,6)
Lbl 1
Loop: check matrix bit by bit, return each value
If value = 1
Then draw grass 4x4 sprite
If value = 2
draw rough 4x4 sprite
If value = 3 and so on
IfEnd
Lbl 2
Menu (Driver:,A,Iron:,B,Wedge:,C,Putter:,D)
Lbl 3
Draw thermometer
Loop: expand line to match swing power like a normal power bar
If max set variable to down
Loop: Shrink line accordingly
If line reaches bottom, go back to menu
If 2nd pressed
Start new line below first, Going down towards accuracy mark
Test accuracy variable with closeness of line to mark
If 2nd pressed, send variables to shot calculation program
Lbl S
Save all variables such as position, club, hole, level pack to list
Lbl L
Load variables from list
Lbl Q
Goto Lbl Z
Lbl X
Use trig, wind value vs z value, and matrix data to calculate new position
IfEnd
Lbl Z
ClrText
"Thanks for playing!
(block done token)
Stop
Lbl A
1->Z:5->D:Goto 3
Lbl B
2->Z:4->D:Goto 3
Lbl C
3->Z:2->D:Goto 3
Lbl D
0->Z:1->D:Goto 3
WOW! a *lot* easier to convert than I thought!
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 18, 2011, 12:16:28 am
That is pseudo-code, not any real BASIC. That is basically how you write down how the program will do stuff, just the structure. I haven't even started coding yet. It is like a flowchart. I needed to space out my thoughts, and I do that with pseudo-code.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 18, 2011, 12:13:50 pm
Yeah, I know; its actually called an algorithm. but its easier (for me) to understand if it uses casio BASIC commands :P
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 18, 2011, 12:19:56 pm
It is also very widely called pseudo-code. The programming teacher at my school yes, I said "The programming teacher at my school".) calls it pseudo-code, and I am sure that many other people do, even on omnimaga. Here is an example: http://ourl.ca/4317
Anyway, I am not sure exactly if Eems called it that, but many people do. I am going to go make a power bar for this, and then a menu.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 18, 2011, 12:26:21 pm
Oh, I'm not saying its not a word, I just was explaining that I knew what it meant. sorry for not being clear :P
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 18, 2011, 12:32:11 pm
No problem.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 18, 2011, 12:41:43 pm
Hey, I'm thinking for matrices:

4x4 sprites

2=green
3=fairway
4=rough
5=trees
6=penalty (pond, rocks)
7=sand bunker
0=hole
1=tee-off area mens'
1.5=tee-off area womens'?


Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 18, 2011, 12:48:15 pm
Thanks for the suggestion. Keep 'em comin' people!
Maybe it should be text sprites, so 5x5. Or 8x8 if I want to do an axe remake. They will be 8x8?
I'll make some 8x8's. But then the course will be small... Can i make smaller sprites in AXE?
P.S. POST 40!!!!!
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: ztrumpet on September 18, 2011, 04:28:17 pm
Can i make smaller sprites in AXE?
You cannot, but you can just make them have white pixels at the edges.  Pt-Mask() is helpful for this.  I've done 4*4, 5*5, and 6*6, as well as 8*8 and 16*16 on various things I've made in Axe.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 18, 2011, 04:34:06 pm
I now have several options.
16x8 map, so I can make a homescreeen edition, also it would eat less ram,
A 23x15 map so I can have 4x4 sprites, or
an 18x12 map so it is text sprite compatible.
I was thinking of making a homescreen edition, a graph screen edition, and an AXE edition.
How does that sound?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 19, 2011, 10:52:27 am
I dont think I quite understand. your trying to do this in 3D? what would the sprites look like?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: LincolnB on September 19, 2011, 08:50:47 pm
Yeah, I don't really get what the perspective/view would be like
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 20, 2011, 11:25:18 am
When you aren't shooting, it is top down. When you are about to, you see from behind the player.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: LincolnB on September 20, 2011, 05:16:01 pm
Oh, so it is a 3d type view? How do you plan to do that from the homescreen?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 20, 2011, 06:23:55 pm
I don't. It will be AXE, at the moment. Expect me to change my mind a few more times.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: LincolnB on September 20, 2011, 06:26:27 pm
Oh, gotcha. Cool :)
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 21, 2011, 10:32:51 am
Ok, I'm still figuring out my version. Now i think itll be top down for the whole game.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: turiqwalrus on September 21, 2011, 01:09:12 pm
Ok, I'm still figuring out my version. Now i think itll be top down for the whole game.
just be careful with prizm graphics... They take FOREVER(~2 hrs. to fill the screen)
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 21, 2011, 02:08:30 pm
Oh, I'm doing it for FX-9860GII--no color, sorry PRIZM guys.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: turiqwalrus on September 21, 2011, 02:11:27 pm
Oh, I'm doing it for FX-9860GII--no color, sorry PRIZM guys.
works better, then :P
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 21, 2011, 02:26:26 pm
Do you have a PRIZM?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 21, 2011, 06:59:41 pm
Don't worry if you change your mind about how it will work a few more times. At one point, mine was going to be on the homescreen, then the graph screen, then axe, then graph screen 3d, and now AXE again. It's okay.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 21, 2011, 07:01:42 pm
Yeah I know.
Quote
Omnom IRC <boot2490>: It [Golf tour] is going to be in homescreen for sure.

LOL
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 21, 2011, 07:04:59 pm
Lol I am very indesicive.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on September 21, 2011, 07:07:20 pm
LOL, ROTFL
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Yeong on September 21, 2011, 08:10:02 pm
@boot try not to have too much going on your head though.
I've given up so many project just because of that same reason. XP
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 22, 2011, 07:36:24 pm
I give up more projects than I start. Don't you lecture me about that. I actually was going to make a pinball machine this summer. If I did, I may never have come here. But I am trying to be ever persistent with TI programming, my Star Trek movie, and my secret agent parody movie.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 26, 2011, 08:44:30 pm
I am making a new poll! Final chance for your input on the format.
AXE: Greyscale, longer release time (still need to learn it), harder to implement
Graph screen: Easier to code, faster to code, slower, B/W scale
Homescreen: in between graph screen and axe in speed, but smaller maps, text only graphics
Libs: the middle option, but libs are less reliable.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: DJ Omnimaga on September 26, 2011, 08:54:08 pm
A golf game would definitively be nice. If you haven't done much BASIC before, I would recommend starting in BASIC, though, then try Axe later. Also keep in mind graph screen graphics in BASIC can take a lot of space and in pure basic be a bit slow.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 26, 2011, 08:55:36 pm
I do have lots of experience with BASIC, and I think I am almost ready to move on. I don't know, though.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: imo_inx on September 26, 2011, 08:58:17 pm
Golf... So... boring...

Can you make a super-ultra-yay-powerups version?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: DJ Omnimaga on September 26, 2011, 08:58:44 pm
Ok, the issue with Axe is that you must learn to backup, backup and backup in case of RAM clears. Also you need to get used to some different stuff. It can be rather easy to learn for some people, though. There's also ASM, but it's vastly different in tems of language syntax.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 26, 2011, 08:58:48 pm
After normal golf, it may evolve to mario golf :D
And don't you dis golf mofo golf is more exciting than you realize
(it is pretty boring though, but I enjoy it ;))
So, I still have to think about it for a while.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: DJ Omnimaga on September 26, 2011, 09:09:57 pm
Yeah let's not start bashing game genres. Also yeah I would plan well if I was you, maybe even writing down what each var do on paper. Don't start too big too. Add features as it takes form.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on September 26, 2011, 09:12:24 pm
I have actually been planning this, with algorithms and methods and subroutine structures and do-overs for ALMOST A YEAR. So I think I know what I am doing.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 14, 2011, 10:31:12 pm
News!
I will make it in AXE.
And here is a badass title screen I mocked up in fourscale.
Enjoy!
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: parserp on October 15, 2011, 12:01:30 am
That is sweet. I had to +1
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 16, 2011, 10:54:29 am
Thanks! Now I just have to figure out exactly where to start.
Can AXE programs run BASIC programs as subroutines? I am more used to BASIC math.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: FinaleTI on October 16, 2011, 11:09:14 am
Thanks! Now I just have to figure out exactly where to start.
Can AXE programs run BASIC programs as subroutines? I am more used to BASIC math.
There is an opcode (http://ourl.ca/4129/181038) for doing so.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 16, 2011, 03:33:15 pm
I am saying that because I think BASIC is easier to use with algorithms. Can you "Include" basic code inside an axe program? Like, inline? I don't want too many sub programs.
Oh, I see. How does that work, the last line?
Also, could I have the program stored into an appvar instead? Or something like that?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: ben_g on October 16, 2011, 03:35:57 pm
you can write it in HEX in your program, then when it's run, create an other program from that data, use the opcode to run that program and delete the program afterwards.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 16, 2011, 03:36:46 pm
How different is AXE math from BASIC math?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: ben_g on October 16, 2011, 03:43:37 pm
If you use integer math, your variables can't contain decimal numbers and can't be bigger than 65536, or between 32768 and -32768 when you use signed integers.

If you use fixed-point math, the numbers can be decimal, but with an accuracy of .004, and they can only contain values between 228 and -228.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Builderboy on October 16, 2011, 05:24:32 pm
How different is AXE math from BASIC math?

Axe numbers use 2 bytes to represent an integer from 0 to 65535.  Using different methods, you can modify this range to be from -32768 to 32768, still integer.  And then using a method called fixed-point-arithmatic, you can store numbers from -256 to 256, but with accuracy past the basic integer.  In hex, your Fixed point number would look like ##.##, where the ##'s represent the individual bytes.  The advantages of Axe math is that they are extremely fast, as well as being directly integrated with all of the Axe functions.  The disadvantages of Axe math is that they have limited accuracy, and don't work as well in cases where extremely high accuracy is needed.

Basic math (in regards to using it in Axe) is extremely limited simply because Axe only supports importing and exporting Basic variables as integers.  Additionally, Axe does not support doing mathematical operations on Basic variables, and lots of Hex code would need to be used to either access the arithmetical BCALLS, or run a Basic program.  Additionally, basic math is much slower than Axe math, because the code is not compiled, and instead is being manipulated by the (inherently) slow BCALLS.  The advantage Basic math has is it's high accuracy, from -1*10^99 to 1*10^99, with a decimal accuracy of 14 decimal places.  Little of this is accessible to an Axe program however, since Axe only supports the integer side of Basic math.

In short, I highly recommend that if you plan to make this an Axe program, you learn how to use Axe fixed point math, as it's not really worth it to jump through hoops simply to use the slower Basic version for a small gain in accuracy.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 16, 2011, 07:49:30 pm
that looks complicated O.O
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Builderboy on October 16, 2011, 08:05:27 pm
which part? 
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 16, 2011, 08:06:55 pm
I'll be fine
I should get coding!
How do you do greyscale is my next question...
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: willrandship on October 16, 2011, 11:14:34 pm
Grey is really qutie simple: It is accomplished by flashing two images onscreen, one after the other, in a special way axe handles for you.

You have two sets of screen buffers: The front buffer (the one you always use) and the back buffer (the one you've never heard of.)

To draw to the backbuffer, you simply add the superscript r (under ANGLE) to a drawing command. To display grey, use either dispgraphr or dispgraphrr, for 3 or 4 level grey, respectively. Those are still the angle rs.

for 3 level: If there's a pixel on the front buffer it shows black. If there's a pixel on the back buffer without a front pixel, it is grey.

For 4 level: front off back on = light grey. front on back off = dark grey, both on = black, neither on = white.

You need to have the dispgraphrr happen really often to get good grey though, once won't do it.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 18, 2011, 11:05:16 am
Could you just draw to the buffers while loading the map and then put the DispGraphrr in a Repeat Getkey()? No animation is needed for golf.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Yeong on October 18, 2011, 11:29:50 am
You need to have the dispgraphrr happen really often to get good grey though, once won't do it.
how about Full mode? :D
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 18, 2011, 11:30:31 am
No full mode! NU!
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Builderboy on October 18, 2011, 01:29:35 pm
Could you just draw to the buffers while loading the map and then put the DispGraphrr in a Repeat Getkey()? No animation is needed for golf.

Yes you could, just remember that in order for grey to work, you need to continually call the DispGraphrr function.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 19, 2011, 10:39:23 am
The repeat should recall it...
But, how do you store a 94x62 image to a pic or something? I only know about 8x8.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Hayleia on October 19, 2011, 11:43:36 am
But, how do you store a 94x62 image to a pic or something? I only know about 8x8.
Two ways for including an image into your prog. Both use the fact that the prog is compiled.
-First, you can convert your image into hex by hand and type it in your source as you would do for a sprite.
-Or, and I'm sure you'll use this one ;) you can store your image in Pic7 (for example) and include at the beginning of your code [Pic7]→GDB8. Then, to display your picture, you just do DispGraph(GDB8).
And if you want greyscale, I think that you could store other images in Pic4 and Pic6 and put them at GDB2 and GDB3, store them to the right buffers and use the right DispGraph command, but I don't do greyscale, so I don't know.
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Yeong on October 19, 2011, 11:47:08 am
or you can do:
[Pic1]→GDB1
[Pic2]→GDB2
and do this:
Copy(GDB1,L6,768                //Front Buffer
Copy(GDB2,L3,768                //Back Buffer
DispGraph
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 19, 2011, 12:09:26 pm
How do you make it non pic dependant? Like having a setup program that updated the pics?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Yeong on October 19, 2011, 12:11:06 pm
You could store it into appvar.
Make a program that do that.
prgmPROGRAM
.TEST
[Pic1]→GDB1
GetCalc("appvPIC1",768)→A
Copy(GDB1,A,768

This will create the appvar PIC1 that contains Pic1
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: boot2490 on October 19, 2011, 05:18:38 pm
Now how do you draw that appvar to the buffer?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: Yeong on October 19, 2011, 05:19:08 pm
Copy(A,L6,768
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: flyingfisch on November 02, 2011, 07:27:22 pm
How are you coming along with this project, boot? Do you have an algorithm for me yet?
Title: Re: Golf Tour 2011 - Not mini golf!
Post by: willrandship on November 05, 2011, 01:15:54 am
Important note: The pic is only needed at compile time, so your users don't need to hang on to it, just you.

Hmm, I should make a var storing axe app, so you can have infinite strings. Handy for BASIC progs that use strings for data.