Join us on Discord!
You can help CodeWalrus stay online by donating here.

[ti-84+ce]Age of CEmpires I

Started by PT_, January 03, 2017, 08:22:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PT_

Got a non-working homescreen done! :D



Total size of the images is around 15K.

p2

looks really nice :)
how's the speed going, did you make further profgress in speeding up the rendering? :)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Sorunome

Quote from: p2 on January 27, 2017, 06:02:05 AM
are you kidding me soru, you learned ez80 within one day...  :ninja:
ez80 asm is pretty similar to u80 asm.

In fact, once you learn one architecture a different one will be easier to pick up. AVR isn't that hard, either, IMO......
  • Calculators owned: Too many (why are you even reading this?)
  • Consoles, mobile devices and vintage computers owned: Gamebuino!
This is a signature.
And now......give me an internet!

To be or not to be.........is that even a question? Who gets to decide this anyways?

p2

Quote from: Sorunome on January 28, 2017, 12:54:06 PM
Quote from: p2 on January 27, 2017, 06:02:05 AM
are you kidding me soru, you learned ez80 within one day...  :ninja:
ez80 asm is pretty similar to u80 asm.

In fact, once you learn one architecture a different one will be easier to pick up. AVR isn't that hard, either, IMO......
I thought it was called z80 after Zilog, the producers...?
u80... <_<
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Dream of Omnimaga

I like the title screen, but you might want to do something about those white text artifacts. :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

I will remove some :)

I've uploaded all the files to Github, in case anyone wants to help or give tips.

https://github.com/PeterTillema/Age-Of-CEmpires-I

Sorunome

Quote from: PT_ on February 01, 2017, 07:47:47 PM
I will remove some :)

I've uploaded all the files to Github, in case anyone wants to help or give tips.

https://github.com/PeterTillema/Age-Of-CEmpires-I
I know this is only remotely related, but.... https://github.com/PeterTillema/Age-Of-CEmpires-I/blob/master/index.php#L84

It is bad practice to place ?> all at the end of a PHP file, as following whitespace would be automatically outputted. Now, if you had your PHP script generate an image or something the following whitespace would result in a corrupt image.
There are more examples where having ?> at the end with additional whitespace leads to weird bugs, hunting them down can be very nasty. So just omit ?> if it's all at the end of the file ^.^
  • Calculators owned: Too many (why are you even reading this?)
  • Consoles, mobile devices and vintage computers owned: Gamebuino!
This is a signature.
And now......give me an internet!

To be or not to be.........is that even a question? Who gets to decide this anyways?

Dream of Omnimaga

On a side note, if your strategy game idea ended up not working, those large building sprites would still be great in an RPG. Many RPGs used isometric view so you could make an RPG based around Ages of Empires.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

That doesn't mind at all. If I can't get a reasonable FPS with AoCE, I can't reach it either with a similar RPG  (-_(//));

Dream of Omnimaga

Well, with an RPG you only need to move one character around rather than 15-20 units per frame with pathfinding and everything :P.  Regardless of what you decide, I'm really looking forward for what you can come up with in the future and I'm hoping you can solve remaining speed issues. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

p2

Is there any update on the framerate @PT_ ? :)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

PT_

Well, yet not, but I decided to add a border around the frame, such that I don't need clipping. TheMachine already wrote a fast routine to display an isometric tile, and I optimized it a little bit more, which should be very fast.

AoCEDisplaySprite:
; Routine written by TheMachine02 and optimized by me
; Input:
;   Arg0: pointer
;   Arg1: x
;   Arg2: y
; Bytes: 213 bytes
; Time:
ld iy, 0
add iy, sp
ld c, (iy+9)
ld b, 160
mlt bc
ld hl, (0E30014h)
add hl, bc
add hl, bc
ld bc, (iy+6)
add hl, bc
ld bc, 15
add hl, bc
ld de, (iy+3)
ld c, 2
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+2-6
add hl, bc
dec b
ld c, 6
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+2-10
add hl, bc
dec b
ld c, 10
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+2-14
add hl, bc
dec b
ld c, 14
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+2-18
add hl, bc
dec b
ld c, 18
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+2-22
add hl, bc
dec b
ld c, 22
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+2-26
add hl, bc
dec b
ld c, 26
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+2-30
add hl, bc
dec b
ld c, 30
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256+1-32
add hl, bc
dec b
ld c, 32
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-1-30
add hl, bc
dec b
ld c, 30
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-2-26
add hl, bc
dec b
ld c, 26
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-2-22
add hl, bc
dec b
ld c, 22
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-2-18
add hl, bc
dec b
ld c, 18
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-2-14
add hl, bc
dec b
ld c, 14
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-2-10
add hl, bc
dec b
ld c, 10
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-2-6
add hl, bc
dec b
ld c, 6
ex de, hl
ldir
ex de, hl
inc b
ld c, 320-256-2-2
add hl, bc
ex de, hl
ldi
ldi
ret

p2

#72
so using the modified display algorythm and witout the clipping the rendering speed should be increased, right? :)
Really looking forward to hear you talking about something like 60fps  :thumbsup:
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

PT_

Time for some small updates. Last days I've been busy with optimizing the routine to display all the tiles at the screen. I've decided to add a border around the field, to avoid clipping, and with the help of both grosged and TheMachine, I got it down to like 711751 cycles, which is really good ;D When there are no more optimizations left, I will start with other stuff, such as the edges of the field and scrolling :)

Entire code (DrawFieldStart = mpShaData, AoCEDisplayIsoTile = cursorImage):
DrawField:
scf
sbc hl, hl
ld (hl), 2
; Speed: 722161/721349/711751 cycles
ld hl, -3
jp mpShaData

DrawFieldStart:
add hl, sp
ld (TempSP2 - AoCEDisplayIsoTile + cursorImage), hl
ld hl, (currDrawingBuffer)
ld de, 15
add hl, de
ld (startingPosition - DrawFieldStart + mpShaData), hl
ld de, 8*320
ld b, 29
DisplayEachRowLoop:
bit 0, b
exx
startingPosition = $+2
ld iy, 0
ld a, 10
jr nz, DisplayRowOfTilesLoop
dec a
lea iy, iy+16
DisplayRowOfTilesLoop:
ld hl, _tile_test \.r2
call cursorImage
lea iy, iy+32
dec a
jr nz, DisplayRowOfTilesLoop
exx
add hl, de
ld (startingPosition - DrawFieldStart + mpShaData), hl
djnz DisplayEachRowLoop
ret
DrawFieldEnd:
.echo DrawFieldEnd-DrawFieldStart

AoCEDisplayIsoTile:
; Thanks a lot to TheMachine02 and grosged for help and optimizations!
; Input:
;   IY = pointer to output
;   HL = pointer to iso sprite
;
; Bytes: 168 bytes
; Time: 2558 cycles

lea de, iy
ld ix, 0
lea bc, ix+2
add ix, de
ld sp, 320
ldir
add ix, sp
lea de, ix-2
ld c, 6
ldir
add ix, sp
lea de, ix-4
ld c, 10
ldir
add ix, sp
lea de, ix-6
ld c, 14
ldir
add ix, sp
lea de, ix-8
ld c, 18
ldir
add ix, sp
lea de, ix-10
ld c, 22
ldir
add ix, sp
lea de, ix-12
ld c, 26
ldir
add ix, sp
lea de, ix-14
ld c, 30
ldir
add ix, sp
lea de, ix-15
ld c, 32
ldir
add ix, sp
lea de, ix-14
ld c, 30
ldir
add ix, sp
lea de, ix-12
ld c, 26
ldir
add ix, sp
lea de, ix-10
ld c, 22
ldir
add ix, sp
lea de, ix-8
ld c, 18
ldir
add ix, sp
lea de, ix-6
ld c, 14
ldir
add ix, sp
lea de, ix-4
ld c, 10
ldir
add ix, sp
lea de, ix-2
ld c, 6
ldir
add ix, sp
lea de, ix
ldi
ldi
TempSP2 = $+1
ld sp, 0
ret
AoCEDisplayIsoTileEnd:

If you see optimizations, feel free to post it :P

_PT

Looks great! I can't wait for updates :)

Powered by EzPortal