Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - coolsnake

Pages: [1] 2 3
1
TI-BASIC / Re: Procedural generation part 2 / Space explorer game
« on: November 06, 2011, 07:43:51 am »
There was a tiny bug in the previous file caused stars not to be generated in the 12th and 13th column, I reuploaded the file with the fix.

I might try to generate a truly unique universe sometime. If my math is right you can have up to 18k unique screens with max 10 stars and 48 possible places to put them. I probably would just bruteforce it though. :p
Generate x amount of lists and compare them using sum(abs(L1-L2)) to see if there are any dupes.
That being said, yeah the difference between a truly unique universe and a highly randomised one is neglible. I doubt someone would really take note of every single screen.

Also if you mean to make a truly persistent universe, 10^8 screens are indeed a bit out of your ball park =P

Lists with 128 numbers take about 1000 bytes which means 20ish active lists at any time.
If you make use of the archive that number goes up to 500. Since they mostly consist out of zeroes you can probably compress them to a 10th the size, meaning 5000 sectors in total. Also if you used some programmer magic you could probably atleast double that number, going up to 10000^^

Here are some interesting numbers:
time to generate a sector using the old method with a string: 7-8 seconds
byte size string with length 128: 100ish bytes
time to generate a sector using the new method with a list:0.55 seconds
byte size list with length 128: 1000ish bytes
byte size compressed list with length 10: 100ish bytes

time to compare 2 lists: 0.13 seconds

I think I could drastically reduce the time using a string if I started using a similar method like I used for the list. Start with a String of 128 " " chars and then intersect some "*" in there. While the code would probably be a lot messier than the one for the list, the advantage would be I could potentially save a whole universe to a single string variable (since the max of a string is limited by ram). Using lists I would be capped at 999 items per list.

2
TI-BASIC / Procedural generation part 2 / Space explorer game
« on: November 05, 2011, 01:12:55 pm »
Here is the first part:
http://www.omnimaga.org/index.php?PHPSESSID=vdu1jt4pj3g1sauc09tcsh89n2&topic=4382.msg61597#msg61597

Recap:
I've always been interested in procedural generation, more specifically the generation of an universe in space.
Last time I posted about this I posted a program that did something like that. You're a little X-spaceship that flies through a dynamically generated universe filled with asterix-stars. It was horribly inefficient/slow and needlessly complicated.

Today after reading a bit about "Movement in Maps","Making Maps" on TI-basic developer I decided to give it another go. I used this code from tibasicdev for the movement.

Code: [Select]
:Output(1,1,Ans
:Repeat K=21 and AB=26   //AB=26 can be changed for different exit point
:getKey→K
:If Ans
:Output(A,B,"_  //One space, checks for key press and erases
:sum(Δlist(Ans={25,34
:A+Ans(" "=sub(Str1,16(A-1+Ans)+B,1→A   //If future coordinate is a space, it moves
:sum(Δlist(K={24,26
:B+Ans(" "=sub(Str1,16A-16+B+Ans,1→B
:Output(A,Ans,"X

While the movement itself was very fluid, a great bottleneck was the generation of a new screen everytime i switched to a new sector. It took up to 7 seconds using a string as the base for my map. While I was able to optimise it up to around 3-4 seconds it was still pretty long. It was a real shame since the string consisted mostly out of empty spaces with some "*"-stars sprinkled in between. I was able to fix it by using a list filled with 0's as a base and randomly put some "*" in there. The result is the generation of new sectors is almost instant now, making the program in total very fast. I added the program in an attachment for those interested :)
The way it's done is very elegant and filesize is almost half of my first attempt.

The way it works is that every screen has its own seed. The calculator then uses this seed to randomly generate a level. If you move one screen to the right, the seed increases with 1, to the left decreases with 1 etc.
LIST.8xp takes care of that and then also generates the level. It makes an empty list of 128 characters(the number of characters that can fit on a calcscreen) and then randomly inserts a star into the list and displays it on the screen.
GAME.8xp is used to start the game. It uses LIST to generate the level and contains the movement loop. It can then use the list to see if the player is bumping against a star or not. When the player moves to another level the loop ends, the new seed number is stored in C and GAME.8xp is recursively opened and then uses LIST.8xp to generate a new level again.

I'm still not able to generate truly unique levels and I don't think i'm able too unless I prerender them all and compare them one by one, which is a bit too calculator intensive. You can have about 10^8 calc screens before changing the seed doesn't matter anymore. The calculator then just keeps displaying the same screen.

Enjoy!

EDIT: tried uploading it again, should work now.

3
TI Z80 / Re: TIPC-Basic
« on: August 04, 2011, 09:39:42 am »


It's been almost a year since I made this library for FreeBASIC. While it's pretty complete in its own right you could see the cracks of the limitations of the library pretty clearly. There were a number of commands that had to be renamed or otherwise they would conflict with native FreeBASIC commands. Conditional statements were pretty much uneditable. This was unfixable by design.

So I went deeper.

I took a look at the sourcecode of the FreeBASIC compiler itself. I'm now able to pretty much rename anything I like. I'm also able to edit the syntax of things like conditional statements. Although the latter is more like fighting in the bowels of hell. Still, I was able to change the syntax of the for loop in FreeBASIC (for A=1 to 10) into the TI Basic equivalent (for A,1,10), so I know it's possible.

What this concretely means is, this brings TI-Basic a whole lot closer to the PC! + You still have access to the goodness of FreeBASIC.

Plans for the future:
- Add more commands
- massive overhaul of everything I created so far. Rewriting documentation, making it more spiffy and userfriendly etc
- compile a client for Windows with the new syntax, add an IDE, add the library and repackage everything in a neat little package.
- Make everything opensource(library + my version of the compiler) so you can muck around with it + the advantage that people with linux/FreeBSD can compile it for themselves.

4
Computer Projects and Ideas / Re: TIBiC/GO
« on: August 03, 2011, 04:03:45 pm »
I made something similar to this in FreeBasic like DJ Omnimaga mentioned in his post.
I'm very interested to see how this will turn out!

5
Computer Usage and Setup Help / Re: Anti-Virus
« on: November 28, 2010, 09:38:07 am »
I've always been a big fan of ESET because it's extremely light on system resources. Especially in comparison to Norton.

I changed to Microsoft Security Essentials a couple of months ago. It's hard to say how good the virusprotection actually is but I didn't run into any serious problems thusfar. It's free, has realtime protection and doesn't continually bother me with nagscreens. That's more than enough for me.

6
TI-BASIC / Re: [CHALLENGE]Logic and Optimization
« on: November 20, 2010, 07:43:09 am »
Why does it take 63 bytes when I enter it into my calculator?

7
I have a question about page 10 from lesson 7.

If you check that A <= 90 shouldn't the ASM equivalent be CP 91 instead of CP 89?
Since you check for the C flag condition, if A were 90 or 89 it wouldn't be set.

8
Other Calculators / Re: OS 2.21 From Calc to Computer
« on: November 13, 2010, 07:02:42 am »
I got TI-OS 2.21 on my good old "Ti Graphing Product CD v 1.1" that came with my TI-84, maybe you do too.
It's near impossible to find it on the internet I think. The closest thing I found was the less buggy TI-OS 2.22

9
TI Z80 / Re: Meishe91's Tunnel
« on: September 21, 2010, 08:10:34 am »
score: 1269 ^^
Fun game!

10
Computer Usage and Setup Help / Re: netbooks - what to buy?
« on: September 18, 2010, 05:51:30 pm »
I was actually wondering what OS he would use if he didn't want to use linux distros or a windows OS.
But yeah I would recommend a linux distro for a netbook  :P
Puppy linux comes to mind for a good allround yet easy to install OS. I'm pretty sure there are variants specifically made for netbooks.
Xpud also comes to mind but it might be a bit too barebones for what you want. On the other hand it is very fast and very easy to install with extremely low boottimes.

11
Other Calculators / Re: TI-84 Plus OS
« on: September 18, 2010, 05:42:32 pm »
A lot of people say the 83+ is quite user-friendly compared to a lot of other calcs that aren't 85/86, but of course if you are a Casio fan you migth think otherwise. A lot of people prefered the 85/86 way of doing menus. I personally don't like them much because I find them hard to navigate but it's cool to be able to see the screen when selecting menu options.

I don't know. If a friend of mine were to ask advice for which graphing calculator to buy and he'd only use it for graphing and he has no interest in downloading any programs from the internet I probably would recommended the Casio. And that's saying alot since I'm pretty much a TI 84+ fanboy  :P

Say he wants to draw a function and he has no prior knowledge of both calculators.

On the Casio he would have some sort of menuscreen, go to Graph, enter the function and press draw.

On the TI 84+ he would have to know that the equations screen is accessed by pressing "Y=" and then he would have to press "GRAPH". With other words he should've read the manual. This might be common sense but meh there probably alot of slackers out there that don't bother to read it unless they really have a problem. I was one of them. I just mashed some buttons till I got what I wanted.

12
TI Z80 / Re: Dwell - Radical different game idea
« on: September 18, 2010, 05:17:31 pm »
I've read about this a long time ago, glad to see it's still alive.
It reminds me of a sandbox/openworld game.
Titles like Mabigoni or even Animal Crossing come to mind.
Good luck with that :) It's not easy but I really do love those kind of games.

13
Computer Usage and Setup Help / Re: netbooks - what to buy?
« on: September 18, 2010, 05:04:15 pm »
So what OS do you have in mind? Excluding linux distros and windows xp/vista leaves very little left.

14
Other Calculators / Re: TI-84 Plus OS
« on: September 17, 2010, 10:13:38 am »
For some reasons, I believe they did this to lure TI-85/86 and Casio calc users. Those calcs only have such menus, no menu like on OS 2.43. Having both type of menus at once may accomodate Casio users while still letting people who had a 84+ for a while use the old 83+ style menus.

That's quite interesting. I never thought of it that way. TI 84/83's aren't exactly known for their userfriendly placements of stuff. :P
Casio on the other hand does it so much better imo.

15
Other Calculators / Re: TI-84 Plus OS
« on: September 12, 2010, 05:10:19 pm »
Quote
By shortcut menus, do you mean the F1, F2 things?  (Alpha, then one of the top menu buttons?)
Because in CLASSIC, only one of them is disabled, which is the matrix one.
Yes, I do. Are you saying that the stuff inside the menus actually work in classic mode? I'm pretty sure it didn't but I might be wrong.
It all works, except for the matrix one (since math print is disabled you can't pretty-print enter matrices on the home screen)

I took the effort of reïnstalling it. You're right... Kinda.
Those shortcut menu's are clearly intended to be used in conjunction with mathprint imo.
seeing as "n/d" gives me a "/" symbol in classic mode. And all the functions in "FUNC" get a prettied up representation with mathprint enabled.
You probably wouldn't have noticed that if they weren't located in that menu. It's also the only reason to use mathprint imo.

I probably should've explained myself better. The only reason I'd upgrade to OS 2.53 is to use those visual representations of functions like "fnint(" which happen to be located in those shortcut menus.
I couldn't care less about the actual shortcuts themselves.

I guess you can use those menus "just" as shortcuts in classic mode. My critique would be that it's extremely redundant since everything in FUNC is also located in MATH and require the same amount of key presses to get to.

Pages: [1] 2 3