Log In  

Cart #wip_ma_20200811-0 | 2020-08-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

-------------------------------------------------------------------------------
Some new things in this WIP since the previous version:

* Added compressed slide data and slide module. This can fill the playfield
  with a static slide. The slide data is kept as a hex string, so each char
  can hold two pixels (with values 0-3). The playfield is 112x64 pixels,
  meaning that each slide is 3584 characters long. Decompressing and drawing
  the slide once to the screen probably takes more than a whole tick, but I
  was expecting it to be a lot slower. Win win!

That looks like this, for no one asking:

aaaaaaaaaaaaaaaaa8255555556802aaaaaaaaaaaaaaaaaaaaaaaaaaa6a6a6a6a6a6a6a6a46aaaaa
56aa80a6a6a6a6a6a6a6a6a6a6a6a6a6aaaaaaaaaaaaaaaaa0aaa0029a00a82aaaaaaaaaaaaaaaaa
aaaaaaaa666666666666666661aa855498550c26666666666666666666666666a9a9a9a9a9a9a9a9
87aa1aa6a6695309a9a9a9a9a9a9a9a9a9a9a9a966666666666666660fea2aaaaaaaa4c266666666
666aaaa66666666699999999999999981ffc6aaaaaaaad30999999999aa000a99999999956565656
565656503ffcfe00902abf3c165656566801a42a5656565699999999999999807ff1ff28120fff4d
09999999a06809099999999955555555555555406ff3fcaa0283ffcfd15555556180020955555555
5959595959595900aff3f0aaa2a8ffd3a419595962008209595959595555555555555401aba3f2bf
fff8fff25055555562026309555555559595959500959406aaa7cbfffffe3ff401959595a30a6309
959500955555555408055406aa8a0c03fff00ffc555555556309830955540805555555400a80541a
90093cb0ffcb8ff855550055a30a0c29554002055555540002a0006941043c3cffc383f81554200a
8000382aa90002805555400000aa01500104bc3fffc390a805000a2a8555003aaa0000a055550000
002a00000000affffbff80a8800002aa2aaaa03eaa80002815400000000a80001406affffcfe40a8
400002bf03ffff3ffa800002000000000002a802a502affffffe00a4000002bf1000000ffa800000
000000000000a80aa401affffffa00240000aabc1afff94ffe800000000000000000280aa0002bfc
a3e904240000aafc6bf3fa43fea000000000000000000000000006ffffa414240000abfcaffcfe90
fea800000000000000000000000000bffaa0142400002bfcbff0ff90ffa800000000000000000000
5000181aaa40102400002afcafc03f90ffe80000000000000000004140001bc00000002400002afc
6bc03e90ffea0000000000000000014942016fffa480001000002afc1af0fa43ffaa800000000000
000004254800bfffa4aa001000002afc02bfe903feaa80000000000000002825080003ffe9280010
00000aa0b0000003feaa8000000000000000a8290800000000000a00000002802c0000c3faaa0000
000000000000aa940a02aabffaaaaa0000000a0002ffff03eaa80000000000000000aa400282abff
fffff8200000080e202aa802aa800000000000000000a50202802abfffffe820000008280b000202
aa000000000000000000802a002200abfc3aabe00000080002fff800a000000000000000000003ea
800fc00000aabf8200000803c0000030a00000000000000000000ffa8100ff002aaffe0280000aaa
c3003c20200000001000010050000ffe81500bffffffc00a80055402c383fc282800000015000001
50003fff8055002aa800000ea00000028e0faa02080000002955000000003fffa05550000001503f
a00000028a0aaaa02800aaa40aa900000000ffffe05555500055503fe80000008028002aa0005550
01a954000000ffffe05a95555469503ffa000000aaa00000000000000000000095403fffe05aa695
54aa543ffa002a9000000000000000000000000025400fffe06aaa9514aa583ffe00aa5000045500
000000000aaa5000000003ffe06aaa9404aaa80ffe80554000015000000000000aa56aa0000013ff
e85aaa9404aaaa0fff000000000000002aaa8000295aaaa90000243ff85aaa55542aba0fff000000
00000002aaaaa50015aaa5550000a90ff85aaa55552aaec3fc000012aaa000015555550000000000
0000e940005aa955052aefc0c0000016aa50000055500000000000001540ea540056a554012aefc0
0500000555000000000000006aaa90015500fa900056a950000aeff0290000000000140000000000
569550000000fa900056a950004afffc290014000000000000000000a55000000003fe800056a950
0003fffc3a4000000000000000005550550002a90003fe800055aa500013ffff0e8000000a800000
000055400000aaaaa003fe8000556a500010ffff0e80001aaaaaaa940000000000056aaa940ffa00
00156a540054ffff028000156aaaa55aa800000000005695540ffa0100055a5400542bffc2a00005
55555aaaaa80000000000555000ffa014001555555542babc3a000005555555555400000aaa00000
000ff8015000555555552baac3a800000555554000000000aaaa00000000f8000000055501540aaa
83fa01400000000000000000aaaa9400400800000008001020000aaa83f000000000000540000000
a5555500000aa0000140bc03e8038aaa8001000000000015400002a8555555000000950001540bcf
ea3802aa40a90000000000040000aaaa00000001002800000169400ffa0042a6429000008aa80000
002aaaa900000055402a940005aa9543e8554155000940015aaa80000aaaaaa5

* The code's been slightly overhauled in the backend. Some minor speed
  improvements and token saving. I'm really worried about hitting the max
  token amount because I'm already at 6020 / 8192. I'm nowhere near the
  character limit, so the slides mentioned above can hold lots of data while
  barely affecting the token limit.

* Attempts to keep things as modular as possible is saving me from duplicating
  a lot of code for no reason. There's always going to be exceptions, though.

* IF/ELSEIF/ELSE branches are slow when you use them frequently on every tick,
  so plans to swap those out for function references are in the works.

* Sorry for no actual gameplay. I plan to use cheap point-in-rect collision
  detection for whole-pixel movement and not worry so much about subpixel
  stuff. Velocities for actors will still retain floating point precision,
  but actors will "inch" pixel by pixel for the amount they need to move, and
  stop moving if they happen to collide with a world tile. It's simple and
  effective when moving small distances. Since the screen's resolution is
  already pretty small, and things won't move faster than 2-4 pixels at a
  time, I believe this is a great route to take.

* I want to maintain a constant 60 FPS throughout the whole experience, so
  there are going to be some corners I'll need to cut later on. The HTML5
  version chugs pretty bad on my Android device when I'm using per-pixel
  shading (the diamond effect, additive strips on the main menu and intro,
  etc). This causes the drawing FPS to drop to 30 FPS while logic is still
  kept at 60, and it's pretty evident that this can cause some issues with
  areas of the screen that don't clear/update frequently.

S'about it for now.
-------------------------------------------------------------------------------
P#80622 2020-08-11 07:36

2

Love the art style of the pictures for the intro!
I can’t quite put my finger on it but the way that the guy looking up at the tower is framed and the way it’s outlined etc looks amazing!

P#80623 2020-08-11 08:34
1

@SmellyFishstiks I appreciate the positive feedback, thanks! You might have been reminded of Castlevania perhaps?

P#80635 2020-08-11 16:34
2

If you're worried about size, with 4 colors in the game, you can store 2.5 pixels per character or 5 pixels in 2 chars. Or you could change your encoding to base 32 and store 10 pixels per character. Or 8 if you want to use a nibble per pixel.
It will cost you some tokens, but depending on the number of slides, it might be worth it.

And it looks gorgeous.

P#80649 2020-08-11 21:03
1

@MrGoober I haven't played a castlevania game yet but they both are pretty ^_^

P#80659 2020-08-12 05:10

[Please log in to post a comment]