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.


Topics - squidgetx

Pages: 1 [2] 3 4 ... 9
16
I always end up with like 50 omni tabs open, then I have to close them all. And if someone wants to open in a new tab, that's what the middle mouse button/ctrl-click is for. Thoughts on this, anyone?

17
ASM / 16x12 sprite routine
« on: October 21, 2012, 05:43:39 pm »
As the title says, I'm having trouble converting Chickendude's 16x16 (really 16xN) sprite routine so I can use it with Axe.
This is the basic code. First however, you'll need to calculate where to draw the sprite on screen and put that into hl, +2 bytes (since it draws from right to left, we start with the right side of the sprite and draw leftward). I'm not really sure how Axe handles inputs to routines, so if i got a little more information i could add that in for you too. The first line loads the x offset, that is, how many pixels away from 0 we are. If you are drawing at an aligned position (a multiple of 8) b will equal 0. If you are drawing at X=1, b = 1. If X=19, b=19%8=3. C should be how many rows you want to draw. Here it's 16 (10h). If you want 12, you would change 10h to 0Ch. And the address of the sprite should be in ix. I also wrote a quick small aligned 16x16 tilemapper, i'm not sure how you draw your tilemaps. None of this uses grayscale, however, so i don't know how useful it is to you. I'd be happy to help write something for you, though. So:
b = x offset (how many pixels away from being aligned the sprite is)
c = number of rows to draw, this could be changed easily to a variable height sprite routine.
ix = address of first byte in sprite
Code: [Select]
47 -  -  -  ld b,a
 0E 10 -  -  ld c,16
 -  -  -  - 
 -  -  -  -  drawPlayerLoop:
 C5 -  -  -  push bc
 DD 56 00 -  ld d,(ix)      ;sprite
 DD 5E 01 -  ld e,(ix+1)
 AF -  -  -  xor a
 B8 -  -  -  cp b
 CA 71 A0 -  jp z,skipSpriteClip
 CB 3A CB 1B F9 srl d \ rr e \ rra \ djnz $-5   ;rotate sprite
 -  -  -  -  skipSpriteClip:
 B6 -  -  -  or (hl)
 77 -  -  -  ld (hl),a
 2B -  -  -  dec hl
 7E -  -  -  ld a,(hl)
 B3 -  -  -  or e
 77 -  -  -  ld (hl),a
 2B -  -  -  dec hl
 7E -  -  -  ld a,(hl)
 B2 -  -  -  or d
 77 -  -  -  ld (hl),a
 DD 23 -  -  inc ix
 DD 23 -  -  inc ix
 11 0E 00 -  ld de,14
 19 -  -  -  add hl,de
 C1 -  -  -  pop bc
 0D -  -  -  dec c
 C2 5E A0 -  jp nz, drawPlayerLoop
 C9 -  -  -  ret

EDIT: This routine will also slow down a little the further away from being aligned you go. We could unroll the shifting loops which, although taking up more space, would be slightly faster and have a more even runtime, or something like a 12x12 version of what i posted over here:
http://ourl.ca/15050 :)

I modified it slightly to draw 12 rows, and changed the jumps to relative jumps. Then I added a couple lines at the beginning so it could read in values passed to it in the r variables ($83A5).
Code: [Select]
.Axe code
DrawT(0,0,L6,Pic1)
...
Lbl DrawT
r2*12+r1+r3+2->r3
r1^8->r2
r3->r1
r4
Asm(stuff)
Code: [Select]
.Assembly stuff
 E5 DD E1 -   push hl / pop ix
 2A A7 83 -   ld hl, ($83A7)
 44 -  -  -   ld b, h
 2A A5 83 -   ld hl, ($83A5)
 0E 0C -  -   ld c,12
 -  -  -  - 
 -  -  -  -  drawPlayerLoop:
 C5 -  -  -   push bc
 DD 56 00 -   ld d,(ix)      ;sprite
 DD 5E 01 -   ld e,(ix+1)
 AF -  -  -   xor a
 B8 -  -  -   cp b
 28 03 -  -   jr z,$+7 (skipspriteclip)
 CB 3A CB 1B F9 srl d \ rr e \ rra \ djnz $-5   ;rotate sprite
 -  -  -  -  skipSpriteClip:
 B6 -  -  -   or (hl)
 77 -  -  -   ld (hl),a
 2B -  -  -   dec hl
 7E -  -  -   ld a,(hl)
 B3 -  -  -   or e
 77 -  -  -   ld (hl),a
 2B -  -  -   dec hl
 7E -  -  -   ld a,(hl)
 B2 -  -  -   or d
 77 -  -  -   ld (hl),a
 DD 23 -  -   inc ix
 DD 23 -  -   inc ix
 11 0E 00 -   ld de,14
 19 -  -  -   add hl,de
 C1 -  -  -   pop bc
 0D -  -  -   dec c
 20 E7 -  -  jp nz, $-23 (drawPlayerLoop)
 C9 -  -  -   ret

Right now, it just crashes on run. I'd be super grateful if anyone could help ;D

*Edited to make the bottom two code boxes show up*

18
Ash: Phoenix / [A:P] Documentation
« on: October 07, 2012, 01:01:11 pm »
Spoiler For Battle Engine Specifications:
The battle engine will be turn based, similar to Pokemon and other common RPG battle engine styles.

Battle Stats: (I've modified this slightly from the original, which was essentially Pokemon, in favor of a slightly different mechanic)
HP: Um, HP. Yeah, self explanatory
MP: MP
Strength: Determines damage potential, similar to Runescape Strength. Sets a max of possible damage.
Skill: Higher skill means higher likelihood of hitting high within your range. (RS attack)
Defense: All around defense, for both physical and mystical attacks
Speed: Determines who moves first
Mystic Strength: Magic strength
Mystic Skill: same (Names may change later on)
Battle Types
Unchanged from the original, there will be 6 battle types: 3 physical, 3 magical, each with their own stat tendencies. Similar to Pokemon, attacks will be typed and bonuses applied accordingly. Each type also has a limited move-learning ability and can only wield certain items. Overall, the mystic types are more unbalanced/interesting than the physical types.
-Warrior: Standard sword and shield dudes. Kind of a bunch of thugs
-Archer: Invisible snipers.
-Assassin: Glass cannons, fast but weak.

-Holy/Spirit: Religious zealots, only their God grants them magic powers. Watch out....
-Undead: They're already dead! What can you do...They're tanks.
-Black/Shadow: Spawn of the night. Fast, poisonous, but even weaker than assassins.

Battle Calculations
Speed calculations: Unlike Pokemon, which uses a fairly black and white method for determining who is faster, my engine will use the following calculation: Speedplayer1/(Speedp1+Speedp2) is the chance that player 1 will go first. This will be realized by the condition rand^(speed1+speed2) > speed2

Damage calculation: Strength/Defense will basically be our indication of how hard we can hit so Strength*AttackPower/Defense is fine for setting the max of attack. Now, Skill will be used to determine the relationship between the actual damage and our base median figure. An unskilled fighter will have a large, low value set. A skilled fighter will be able to consistently hit in a high value, small set. So, we'll use an inverse relationship in which the range of damage is (256 - Skill)*dmg/256 This value will be subtracted from the maxdmg from the Strength/Defense section of the equ, making a level 1 skill fighter hitting anywhere from 0 to his max, while a level 256 skill fighter will always hit his max. This is then algebraically optimized to (Skill )*Max/256+Max. Attacks can have power levels generally capped at 256, while items will simply increase the stats of strength, attack, etc. Note that this means that if you can get your net skill over 256, say with a skill level of 200 and a sword of +100 skill, you can hit consistently over the "max damage" determined by the Strength/Defense calculation. If at any point overflow is detected, the damage calculation subroutine will exit and simply return 65535 as the amount of damage to be dealt.

There will be a type-advantage mechanic nearly identical to Pokemon's. Table below:
x Wr Ar As Ho Un Bl
Wr 1  2  1  2  .5 .5
Ar 2  1  2  2  .5 0
As 2  1  .5 1  1  1
Ho .5 1  .5 1  2  2
Un 1  1  1  1  1  1
Bl 1  1  2  .5 1  1


Stat Calculation
Stat calculations will follow the following formula:
Stat = (BaseStat*16 + TrainingExpValue) * Level / 100 + 5

Base stats for the player types here:
  HP MP Str Skl Spe Def MSt MSk Total
Wr 12 8  12  8   9  10  8   8   74
Ar 11  9   10  12  11  7   8   8   80
As 9  7   13  13  13  5   7   9   86
Ho 12 11 5   5   9   9   12   12  75
Un 14 10 15  7   6   12   12   6   82
Bl 5  10  12  12  15  4  13  14   87


TrainingExpValue is determined by what moves you use. Every time you use a certain type move, the corresponding stat for total "points" will be incremented. Points convert to TrainingExpValue by dividing by 8.

With this system, the highest a stat can be (not minding the TEV) is the Black/Shadow lvl 100 speed, which is 245.

Levels are grown with experience via the following formula:
To grow to level n, you need:
exp(n) = 2n^2+2n
samples exp(6) = 84XP
exp(30) = 1860XP
exp(60) = 7320XP
exp(100) = 20200XP

Instead of bothering to keep track of total XP, I'll only keep track of how much to the next level, avoiding annoying overflow problems, plus I'll save a few bytes in the calculations too :D.

Enemies will give experience simply by averaging all their stats together then multiplying by a constant. I'll figure out what that constant is, but as a rough rule of thumb lvl 100 enemies will give roughly 2k xp and lvl 3 enemies will give ~10 xp.


Spoiler For metadata:

___________________
|Player save files|
|_________________|

L4: Available space: $100

$00-$09:Player Name (9 chars, 1 null terminator)
$0A-$oB:Xpos
$0C-$0D:Ypos
$0E-$0F:MapID
$10-$11:OverworldX
$12-$13:OverworldY
$14-$15:Money
$16-$17:XP to next level   ;Battle stats
$18-$19:Level
$1A-$1B:Player Type
$1C-$1D:Strength
$1E-$1F:Skill
$20-$21:Speed
$22-$23:MStr
$24-$25:MSkl
$26-$27:Def
$28-$29:HP
$2A-$2B:MP
$2C-$2D:Weapon attacks (2)
$30-$33:Skills (4)
$34-$39:Type XP
$3A-$3F:Equipped items      ;weapon, shield, armor, hat, amulet, 6th item?
$40-$7F:Items         ;Items- Item ID, qty. $20 item slots (32d)
$80-$9F:Player flags      ;$20 player flags (32 bytes, 64 nibbles, 256 bits)
_______
|Flags|
________


Memory Allocations


$8000 section:metadata swap-in space
$8000-$801A: Map Metadata
$801C-$801D: Direction player is facing
$8020-$8036: Item Metadata
$8040-$8056: Move Metadata
$8058-$8096: Swap area for drawing bitmaps

L1: map spritebuffer (384) map char-store-area (64)
L1+500: list item freeram (battle moves, items, etc)
L2: NPC convos
L3: backbuf
L4: Player save data
L5: Enemy battle info
L6: frontbuf
tempvar: map
tempvar+1024: overworld map
tempvar+1152: sprite anim
tempvar+3200: map padding?


There will be a master-map...a tilemap of map pieces...each map 'piece' will be 32x32 tiles


____________
Map metadata
------------

$1B bytes per entry
$00-$15:name (21 characters, plus null terminator)   (MName)
$16:   tileset                (MapTS)
$17:   avg level of enemies             (AvgLv)
$18:   enemy type 1                (Ene1)
$19:   enemy type 2                (Ene2)
$1A:    enemy type 3                (Ene3)


_____________
Item metadata
_____________

$17 bytes per entry

$00-$0F:item name (15 chars, plus null terminator)    (IName)
$10-$11:itemID                   (ItID)r
$12:   equip or useable?             (IFlag)
$13:   stat to affect (0-7)            (IStat)
$14:   how many points to increase/decrease       (IStat+1)
$15:   stat to affect 2             (IStat+2)
$16:   points to inc/dec 2             (IStat+3)

_____________
move metadata
_____________

$17 bytes per entry

$00-$0F: move name (15 chars, plus null terminator)    (AName)
$10: move type                   (Atype)
$11: move animation               (AAnim)
$12: damage                  (Admg)
$13: stat to boost1               (AStat)
$14: amt to boost               (AStat+1)
$15: stat to boost2               (AStat+2)
$16: amt. to boost2               (AStat+3)


There will be a master-map...a tilemap of map pieces...each map 'piece' will be 32x32 tiles


____________
Map metadata
------------

$1B bytes per entry
$00-$15:name (21 characters, plus null terminator)
$16:   tileset (might not use this, since now maps have access to 192 tiles at once)
$17:   avg level of enemies
$18:   enemy type 1
$19:   enemy type 2
$1A:    enemy type 3


_____________
Item metadata
_____________

$17 bytes per entry

$00-$0F:item name (15 chars, plus null terminator)
$10-$11:itemID
$12:   equip or useable?
$13:   stat to affect (0-7)
$14:   how many points to increase/decrease
$15:   stat to affect 2
$16:   points to inc/dec 2

_____________
move metadata
_____________

$17 bytes per entry

$00-$0F: move name (15 chars, plus null terminator)
$10: move type
$11: move animation
$12: damage
$13: stat to boost1
$14: amt to boost
$15: stat to boost2
$16: amt. to boost2

Spoiler For Program spec:

*********
*Outline*
*********

Title Screen
   Draw title screen
   Menu*

if new game
   new game*
else
   load game*
end

setup*

loop
   if menu key
      main menu*
   end
   if arrow key
      move*
   end
   if interact ket
      interact*
   end
   counter++
   if counter = battlecounter
      battle*
      battlecounter = random
   end

   dispgraphrr
end

**********
*New game*
**********
intro cutscene*
   run cutscene* 0
ask name
   pokemon style input box
set new player values
   zero everythign
   set level to 5
   call stat calculation*

***********
*Load game*
***********
find save file
copy into L4

*******
*Setup*
*******

Load x,y to X,Y
MapLoad*
Draw Map()

***********
*Main Menu*
***********
Draw menu*
>Items
   loop items, display in list (L1+500)
   upon selecting item, use/equip, or drop
   use> look up behavior
   equip> equip that shit
>Save
   save game;
>Quit
press clear, return to game (redraw map)

********
*Moving*
********

if still centered movement:

for 8
shift screen in direction of movement
draw shifted in sprites
show screen
draw
end
for 4
shift screen
draw shifted in sprites
show screen
end
increment x, y accordingly

otherwise

draw tiles over character
move character

if character moving off of edge of map
check if other map available*
map load
scroll whole screen over
change coordinates accordingly to fit onto new map




**********
*Interact*
**********
Search npc database
   >if found, npc()*
otherwise, search trigger tile database
   >if found, npc()*

*****
*NPC*
*****

Copy from embers/old version of Ash
look up convo from argument in npc meta
load convo into L1+10 or somethingg
execute...


Slight change, all npc routine vars stay in L1
L1,L1+1 size of convo
L1+2,L1+3: position in convo

********
*battle*
********


calculate enemy, level, stats of enemy, etc...his battle stats will go into L5


DrawBattleScreen:
   draw character
   draw enemy
   draw hp boxes
   draw action box


playeraction:
   select action
   >attack
   >item (just run item routine)
   >run
      Attacking:   
         display list of moves
         select, execute
      AttacK:
         look up move in movemetadata
         damage formula, animate, apply stat changes, etc

enemyaction:
   random move select
   attack
animating:
erase player sprite
apply animation


Loop
   decide who goes first
      if bla
      playeraction()
      enemy action
      else
      enemyaction   
      playeraction()
   drawbattlescreen
end


End of battle recalculate stats...this will reset battle stat changes and also enable stats to change slightly due to EVs w/o leveling up

return
L1 not touched, npc data remains secure

























19
TI Z80 / MOVED: I have a problem
« on: September 10, 2012, 12:51:10 pm »
This topic has been moved to General Calculator Help.

http://ourl.ca/17000

20
TI Z80 / Temple Run [Axe]
« on: August 31, 2012, 09:50:52 pm »
So I mentioned a couple weeks ago in the Ideas/Inspiration I might pick up porting Temple Run as a project...

Originally I thought I would try to use Mode7 or something, but in the end ended up making a near-complete 3d engine to work it :P So if I can keep the speed and figure out how to do textures as well, I might release the 3d engine as a separate useable library. The engine is really quite nice, it's all based off of a Point() routine that takes x,y,z, and a pointer and writes the x' y' values to the 4 bytes pointed to (also within the routine cameraX, cameraY, and vanishing point are controllable).


Well, it's now in a playable-enough state that I decided to make an official thread, along with a download and screenie, of course. It's still wireframe, making things kinda hard to see and some of the collisions may be glitchy, which is why I'm enlisting your help in fine-tuning it.

You are the black square (sprite coming soon!). There are no turns (yet), only holes, walls, and things to duck under. Use 2nd to jump, Alpha to duck. There is still a lot of work to do, but it's pretty cool as is already (at least I think so)

Edit: And I need a clipped line routine :(

21
General Calculator Help / MOVED: Mirage OS usage
« on: July 03, 2012, 01:16:00 pm »
This topic has been moved to Axe Language.

http://ourl.ca/16500

22
Music Showcase / Squidgetx's music dump
« on: June 12, 2012, 10:14:02 pm »
I've been forgetting to post! I've made a few new songs, which you can find on SoundCloud:

Memoirs
Soft Shell
All Through the Night

These three basically show how I've been messing with different chord progressions and instruments lately...Enjoy!

23
TI Z80 / MOVED: [Contest] Grammer Tennis
« on: June 11, 2012, 03:16:16 pm »

24
TI Z80 / MOVED: text thingy for RPG
« on: June 06, 2012, 03:04:54 pm »
This topic has been moved to Axe Language.

http://ourl.ca/16351

25
TI Z80 / MOVED: scrolling map
« on: June 04, 2012, 04:19:16 pm »
This topic has been moved to Axe Language.

http://ourl.ca/16336

26
The Axe Parser Project / MOVED: TJAR game
« on: May 31, 2012, 03:10:51 pm »
This topic has been moved to Z80 -- ASM/BASIC Projects.

http://ourl.ca/16300

27
The Axe Parser Project / MOVED: External variables in axe parser
« on: May 30, 2012, 03:19:48 pm »
This topic has been moved to Axe Language.

http://ourl.ca/16285

28
TI Z80 / [Contest] Embers:Phoenix
« on: May 27, 2012, 07:49:55 pm »
So while I haven't actually done any coding yet, I've decided on what I'm entering in the contest this year :D

The sequel to Ash:Phoenix-Ember:Phoenix
(Well actually in my mind there would be 3 games if I were to realize this series...Ash, Flame, and Embers).

Anyway, going against your typical FF style RPG (Verdant Forest) I'll be putting something more similar to Desolate together. Combat will take place in real-time against enemies with *gasp* (hopefully good) AI. The story will take place in the future, at the twilight of Earth's humanity. Society has begun to crumble...there have been no technological innovations for the past 300 years and the Earth is dying. That is, until the current head of the world government gets wind of a rumor that the formula for immortality has been discovered. He decides to send his top agent (you) to investigate...And the adventure begins.

Some specs I'm thinking about:
-8x8 monochrome, for speed and convenience
-Byte-sized tiles instead of nibbles for less intensive data organization and more variety in tiles. This is possible since each tile is 8 bytes as opposed to 64 in Ash:Phoenix.
-Pokemon style smoothscroll tilemapping
-A small variety of weapons
-Very smart/tactical AI (this is the hardest part XD)


29
Axe / MOVED: AxeLand (land your space ship)
« on: May 16, 2012, 03:27:33 pm »
This topic has been moved to Z80 -- Axe-Language Projects.

http://ourl.ca/16166

30
Math and Science / Scale of the Universe
« on: February 01, 2012, 11:22:19 pm »
Scale of the Universe

This is just something kinda cool a friend showed me. It really gives you a sense how small we really are  :-\ (And how small a quark is...and how massive a quark is in comparison to the strings in string theory)

Pages: 1 [2] 3 4 ... 9