CALCIV
Civilization in full TI-Basic on a graphing calculator

(Ill come up with a prettier post later)

Hi, first post, but pretty big one I would say. I am undertaking a goal of porting Civilization (Specifically, Freeciv Classic ruleset) to the graphing calculator. And, in TI-Basic. Because TI decided that asm programs bad now and I want everyone to be able to play this without much hassle.

Currently, its still in very early stages, but I have the map system built, with 5 unique tiles (2 textures, one for ocean, one for land, 2 colors and 3 colors respectively.) It uses the graph functionality by making arbitrary lines, and is usable with the arrow keys.

Now, you might say, this isnt impressive. Youd be correct because I didnt tell you the hard part about making that-
TI-Basic matrices can only store 400 elements, or a 20 by 20 map.
TI-Basic lists can only store 999 elements, or a 30 by 30 map.
So, I made a system in the second data program that comes with the main program that automatically switches between four lists with each being a quadrant of a 60 by 60 map. A 60 by 60 map also just so happens to be approximately the size of a civ 6 small map, so good progress. Also there are 3 tiers of that map each with 4 lists, one for terrain, one for buildings, one for units, but thats all technical details you can reason by looking at the program and reading the hopefully helpful comment left in the second program.

Hopefully I have enough motivation to contiune, but for now, take this public beta on github.
www.github.com/BattyBest/CALCCIV
I forgot to include a crucial library, haha oops, that most likely resulted in it just mysteriously crashing whenever opened, or messed up the graphics severely.

That's fixed now, just follow the instructions on GitHub and it should not throw an error. I'll try to NOT be stupid next time.
This sounds like an interesting project! Do you have any screenshots you can share?
Of course!

This is a dev build (ignore "public beta 1" on the last screenshots, I didn't update it yet), so far I have implemented black lines in case that tile doesn't exist (rollover to emulate a round earth will be added later) and simplified the textures so that they are faster to draw on the screen. TI-BASIC, every drop of performance matters here.


CALCCIV map viewing in real-time (It was actually done on CEmu, surprisingly CEmu is really inaccurate about the speed of the map viewing. Even on 150% emulation speed, the real hardware is still faster. Possible bug)

Still image of the map.

Map generation screen (its horrendously slow- sorry, it's still TI-BASIC here. Pick 30*30 size and it should be done in ~10 minutes)

Quick edit, the free space on the right will be used for the GUI wall that freeciv and civ II have.
Just so the, like 3, people following this project don't think I have abandoned it, this will a news post.

The next update is going to include the skeletons of a gui, the skeletons of the city management, proper new game creation, and (maybe) the units system, along with the rollover effect in the previous post.
The gui is about ~75% done, though quick note you will need to redo gdstand because the dimensions changed
The city management has not yet been started
The units system has not been started
and the new game creation screen is about ~25% done.

ALSO, very important!: If the anyone has ideas for a better map generation and/or how to implement proper ai players, please tell me. For the map generation, I am thinking of maybe a couple of pre-defined 5*5 map chunks, with the bulk of the generation happening in a 6*6/12*12 matrix. AI I have no clue where the begin yet. Ideas even if terrible are appreciated.
Very nice!
I like the art style. I'd like to see buildings in that color stick figure style. Smile
This is a fantastic project, the graphics look very playable for BASIC Smile If you post your map generation code, I'd love to help you speed things up (and maybe others will help too?) Aha! There's a GitHub link in the first post! You should upload some of your other programs to our program archives!

Are you ok with me moving this topic from the do-it-yourself subforum and into the Your Projects subforum, so it is eligible for our Projects of the Months news program?
A few things,

first, yes, I have 0 objections to this being moved to the your projects subforum instead.

Secondly, progress will be slowed down for an indeterminate amount of time (mostly likely 1-2 months) as my computer is broken and all the coding needs to be done on-calc, this also means no updates to the public or screenshots for that time period. Sorry. (At least it is still TI-BASIC and no ram resets can happen, eh?)

Thirdly, I am glad the artstyle is not horribly terrible, still needs a lot of speed up though.

Lastly, a note about how this is going to work, in order to not need to redraw the screen multiple times when only one element needs to be updated, this program will make heavy use of the storepic and recallpic functions. This means do not delete pic1 pic2 or pic3, unless you want your archive to degrade severely and gameplay to be interrupted by defragments. EDIT: This may change in the future by drawing white lines instead, but that would require immense amounts of fine tuning
Update post/Dev Diary/Thingamajig

The GUI is looking great, whereas before it felt really empty and bare, now it feels more cluttered and like you have to do so many things, which is really great for civ as no one likes just pressing next turn a hundred times.

For the city system, I have decided to store all the names in a modified version of numtext (from a different project, wont be exposed to the end user anyway) in a list, which will be able to support 76 cities with 13 characters for the name of each city. Similarly, cities information will be stored in a list as well, also 13 numbers in the list for each city just for convenience sake. Instead of storing each building as a boolean value, which would require massive lists, buildings will be stored as multiples of primes. AKA each building has a prime number attached to it and if the building number in the city is divisible by that prime, that building is present. Compression, its good. In the building layer, each city will be 100+its id, so the ids can be yoinked straight from the map.

Units will have sprites, which wont be a person but instead something that represents it, like a bow for an archer, a club for a warrior, a radiation symbol for the ultimate solution, etc etc. Each unit will have a pre-defined attack and defense value, which, once I figure out how it works in freeciv, will be identical to freeciv. Likewise, they will have a movement score, and each terrain tile will have a movement penalty score. And again, I need to see hiw freeciv does it, and implement it that way.

Still no screenshots for now, sorry, screenshot machine still broke.
Are you using textlib to draw the colored text? I would highly recommend using Celtic Ce, which is just a Ti BASIC hybrid library. It would allow you to draw actual sprites very quickly from a matrix and still use the full screen without any graphing borders
I know Celtic CE exists (and it is very convenient too!), its just that I am
1. More familiar with just pure TI-Basic
2. Want this to be able to run without messing with ASM stuff
3. Want this to be an actual challenge to get it to perform well

Anyone is welcome to port this to Celtic though, that would make it perform much faster!
ok, I feel the same that you do about asm. Thankfully Celtic ce is a way to get asm level functions while still staying with Basic but I understand that it would still be a jump. I'm sure that others including me would be willing to try and redo the sprite work using Celtic Ce. Other than the 8xp file on github, is there a way to obtain the source code for your project?
No, but the 8xp is pretty much all you would need. Its not obsfuscated in any way- it even includes comments!
EDIT: Disambiguation for what each .8xp does, CALCCIV.8xp is the front-end, which decides what to call in CACIDATA.8xp (CAlc CIv DATA) which contains the sprite files (in Line( command form), the extra large map support (and will contain) terrain, unit, ans building stats, etc etc. Both will need to be edited to make CALCCIV fullt utilize Celtic CE. GDSTAND.8xp literally just puts one graph in GDB9, no need for that to be edited.
One computer later, and now progress can resume!

Here is what the new game generation looks like, beginning to end:

(There is a sneak peek of the half-finished gui too)

Along with this, you can see a tiny piece of text that says "Retrieving city names" at the end, that's because as discussed previously, the names are stored in a list and then moved to a string for convenience. Update might come out sometime next week.

PS 1: The world generation is sped up in the screenshot

PS 2: The rest runs at 200% on cemu, my physical calculator runs much much faster then cemu for some reason

nvm, cemu decided to record at normal speed, for some reason
Hello! I am, after some devving, back! I have added:
- World Topography Options (Topography itself is broken at the moment)
- A Console
- A Changelog
- An exit button in the main menu
- A click menu
- The only current option being "TERRAIN" which displays the name of the terrain that tile is
- A (very extensive!) debug mode
- QuickGen, which can generate 30*30 and 60*60 way WAY quicker than the previous method
- Nesting Options in the World Gen

Along with the regular load of performance improvements.

And here is an animated png showcasing all the new stuff!
nice! I was worried this had died
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement