Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: willrandship on October 16, 2013, 10:49:14 pm

Title: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 16, 2013, 10:49:14 pm
Here's my contest entry so far.

Toy Wars
A simple, easy to play turn based strategy game.

I've been working on the map system. The plans right now are up to 5 players, with each being selectable as AI or a player. Teams cannot be allies. If you want to be allies, then be the same team. ;)

Each unit can move one square, attack, or use an item. An order is in the form of a direction only. Teams move all their units simultaneously, so a turn may have you making upwards of 20 actions.

Each unit represents six soldiers, each with their own health bar and attack. Attacks are non-random in terms of damage, but random in terms of which soldier they hit. Thus, battles, while predictable and fair, are still never quite the same. (One team loses a soldier early, dealing less damage)

Shelters restore each soldier left in the unit by 1 HP, consuming one use in the process.

There will also be various forms of ranged weapons including lasers (straight line away from user), cannons (explosion away from user), and other items.

Other non-unit items include breakable and non-breakable barricades, one-time health packs, etc. (I am taking suggestions as long as they're reasonable)

The editor is already mostly finished. Changing a unit type takes some time, unfortunately, but I can't think of a way to make it any faster than it is. (it already does dirty unit checks so it doesn't redraw the whole map) Changing health is much faster.

The map generator is extremely simple right now. It generates random numbers and places them in the map if they're valid. Health is always 999999 (full) for soldiers, and a random int from 5 to 15 for houses.

I figure with 5 teams and a fair amount of terrain, the replay value should be quite high.

The screenie is a little slow, since it's running in an 83+ on the emu. On an 84+ it runs a fair amount faster (but never as fast as I'd like: The cursor is reasonable instead of unbearable, but not really fast)
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: ElementCoder on October 17, 2013, 04:43:46 am
That's looking pretty good :)
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 17, 2013, 11:26:50 am
I thought of another optimization for my "dirty" redraws. If I keep a count of how many tiles are dirty, then redrawing tiles at the top will be faster. (since it will exit the draw loop earlier)

I'm also considering releasing a non dual-layer version for the 83+. It's so much slower than I expected.
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: DJ Omnimaga on October 17, 2013, 01:46:54 pm
Looks interesting, and I like how you use dual layer ASCII with small fonts. Most people used that technique with large ones before.
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 17, 2013, 02:01:52 pm
By using small fonts I preserve compatibility with custom fonts, too! (The variable width font isn't part of that, at least in zstart)
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: DJ Omnimaga on October 17, 2013, 02:09:09 pm
Yeah true, if someone uses custom fonts that can be a problem for certain games if they need the default fonts to display normally.

However with Omnicalc that isn't a problem, because on the graph screen, even if you have custom fonts enabled it will still use the default TI fonts. Omnicalc custom fonts only works on the homescreen.
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 17, 2013, 02:09:47 pm
On zStart it actually patches the old fonts out. Even asm programs use the new font, if they use the system font.
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: DJ Omnimaga on October 17, 2013, 02:48:04 pm
Oh wow I didn't know about that. >.<
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: Sorunome on October 18, 2013, 05:59:35 pm
This is looking insane O.O
How am i supposed to compete against that :P
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 20, 2013, 07:49:38 pm
So, the todo list on this so far is:

Write the order menu for player input
Write the order processing subsystem (ie make a turn happen)
Add in the other field items, often with their own subprograms.
Write the AI, which is called for each unit to determine its orders
Write the "effect" program, which is run by the order processing subsystem.

I'm running out of time. x.x I hope I can finish it in 2 weeks.
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: TIfanx1999 on October 22, 2013, 12:25:30 am
That's looking quite nice will! At least make sure it's in a playable state by the deadline. Even if it's not finished, you can still submit it. :)
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: Streetwalrus on October 22, 2013, 10:50:22 am
Yup, really nice. ;)
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 26, 2013, 04:36:36 am
The part I'm working on atm is the most important part: The turn processor. It takes the orders for any given tile and processes them to a buffer matrix, writing the result back when done. It also calls the effects engine, which is done but has no actual effects in it XD

I made the editor significantly faster on tile changes, assuming you're editing the upper part of the map. It will also make turn changes faster.

Why doesn't BASIC have a mod function? fpart is all well and good, but I need it so often that it would be far more convenient.

BTW, currently all the subprograms come to about 3400 bytes. However, the game uses matrices A-E at 1226 bytes each, so running the program takes more memory than storing it.

A map consists of A and B. C is the current orders for each tile, and D and E are the buffers for type and HP.

In other words, to run the game takes a little over 10K of RAM.
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 26, 2013, 07:31:06 am
Screenshot update! This shows off the order system, turns between players, and the animation subsystem. (the current animations are pretty mild, mostly text, but CAN be anything you want, including short, nonlooping animations.)

There's a new bug in my combat code: Now units don't take damage >.<
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: Sorunome on October 26, 2013, 04:37:36 pm
that is looking cool! :D
Title: Re: [contest 2013 / BASIC] Toy Wars - Willrandship
Post by: willrandship on October 26, 2013, 05:03:46 pm
Thanks!

I got the HP bug worked out (I forgot the =0 on an if(something=0) so it was running in reverse XD

Now I'm working on the AI. It's using a simple scoring system for each direction, and taking the best. Using shelters to heal is above attack, which is above being able to move (which is random in score from 0 to 4 to avoid predictability). Proximity algorithms would be much slower, so I'll avoid them if I can. The AI is very simple, since it only has to return a single value from 0 to 4 each time it is called.

As of Right now, the AI appears to be functioning. ;D

I think I won't add any other stuff, at least not for the contest entry version. I'll try to polish up the graphics, and I still need to do Code commenting for the submission.