@2DArray@mastodon.gamedev.place avatar

2DArray

@2DArray@mastodon.gamedev.place

i make games and silly code demos.

some of my games:
https://2darray.itch.io/

free gamedev tutorials:
https://demoman.net/

This profile is from a federated server and may be incomplete. Browse more on the original instance.

2DArray, to random
@2DArray@mastodon.gamedev.place avatar
2DArray,
@2DArray@mastodon.gamedev.place avatar

starting to think about a title screen but i'm not really sure wut to do yet

but hey i have an easy way to make text into 3D meshes (thank you, blender!) so that seems like a sane place to start

A black Playdate screen with the text "Trackminia" displayed in the middle. The text slowly rotates slightly back and forth in 3D, sort of like a wind vane.

2DArray,
@2DArray@mastodon.gamedev.place avatar

@fsouchu i was thinking about drawing the sun...but i think at the moment i'm interested in getting the title card to look like it's own thing, instead of just showing what the normal gameplay looks like (dunno if it's the right call, but that's where i'm at so far)

the motion here is temp, but it's partway to something more interesting...

a title card reading "Trackminia" in front of a waving checkered flag

2DArray,
@2DArray@mastodon.gamedev.place avatar
2DArray,
@2DArray@mastodon.gamedev.place avatar

starting to draw a proper car - i did this first version in a really basic way so i thought it'd tank my performance, but it turns out it still stays at like 45+ fps on the device. not bad!

i'm very bad at lowpoly modeling so the car accidentally looks like an old-timey beater, but i think that's sorta funny so i'll probably try to keep that vibe

video/mp4

2DArray,
@2DArray@mastodon.gamedev.place avatar

working on replay recording/playback - yes, the clip looks the same as the others in the thread, but it's a pretty good run since i was retrying the map. if you think "i see places where the racing line could have been improved" then the game is working, lol

replay data is quite small: stores keyframes containing a bitmask of user-input states (one byte), along with how many frames you held that state for (one byte). a "normal" 30 second replay tends to be around 200 bytes

2DArray,
@2DArray@mastodon.gamedev.place avatar
2DArray,
@2DArray@mastodon.gamedev.place avatar

@Felice thanks!

implementation is dead simple: it's the exact same as what you'd do for Bayer dithering (dither pattern is a pixel-grid of brightness values, each final screen pixel becomes either black or white by comparing its intended brightness to a value in the pattern), but with a blue-noise texture as the pattern

i got a texture from here:
https://momentsingraphics.de/BlueNoise.html

in this case, the dither pattern is fullscreen, but tiling a smaller pattern is fine, too

2DArray,
@2DArray@mastodon.gamedev.place avatar

been pretty busy for a few days, so not much progress here - but i've started getting into a track editor

initially this is just for me to make some built-in tracks, but i might polish it to make it user-facing if i can figure out a comfy way for people to share their maps

some footage of the racing game - the video starts on the title screen, then the user goes to a main menu and picks "build: new track." they use a 2D interface to set up a spiraling track, and then they do a test-race through the route that they've made.

2DArray,
@2DArray@mastodon.gamedev.place avatar

i can now save tracks as files, and then load them - the ghost-car in this clip is included in the track data. the spiral track file (including that ghost's replay) is 161 bytes

zipping the file actually makes it larger (241 bytes) so i think i did good. lol

more footage of the racing game. the video starts in a "load track" menu, which shows 2D previews of the track files which are available to play. a spiral-shaped track is chosen, and then the player races through it while competing against a pre-recorded ghost car

2DArray,
@2DArray@mastodon.gamedev.place avatar

conveniently, i already wrote a playdate serializer for C, for that previous music-maker app

here's the code for serializing/deserializing a track and its replay. serialization and deserialization use these same functions (the Serializer has a flag to tell it whether it's reading or writing) - so there's no need for annoying/error-prone "near duplicate" routines for input/output

it supports ascii format (more legible) and binary format (smaller file)

Another small bit of code, showing two functions called "Serialize Track Piece" and "Serialize Replay"
An example of what a track file looks like in ASCII mode - values have descriptive labels and related pieces of data are grouped together with curly braces and indentation
An example of a track file in binary format - it's a bunch of garbled looking nonsense, but there's much less of it compared to the ASCII version

2DArray,
@2DArray@mastodon.gamedev.place avatar

mostly boring backend stuff lately, but here's a clip of a track i made on the playdate and then loaded in the desktop simulator app - it includes four replays to compete against (bronze, silver, gold, author), and it seems like i can afford to show them all at once!

another video of the racing game. this time we load a track from a screen showing a top-view 2D preview of the map, and then the player races against four ghost-cars of varying skill levels.

2DArray,
@2DArray@mastodon.gamedev.place avatar

@fsouchu yeah that seems like a good idea! may need to sort the cars by camera-distance but that seems cheap since there are so few of them anyway

2DArray,
@2DArray@mastodon.gamedev.place avatar

reduced the framerate to 30fps since it still beats that on the device, but in doing so i instantly radicalized myself into one of those "30fps is literally unplayable" people, so now i guess i have to optimize for 40 instead

(30 is fine with me in other games, i'm just used to 50 in this one)

2DArray,
@2DArray@mastodon.gamedev.place avatar

whelp turns out i can't figure out how to get it back to 40 (particularly with 4 ghosts active) but 30 actually looks fine on the device - the lower framerate is only noticeable to me when testing in the desktop simulator

something something magic playdate screen. good enough!

2DArray,
@2DArray@mastodon.gamedev.place avatar

added a way to save your replay from the daily challenge, as a way to "chess by mail" against your friends without having to author a map first

also a nice idea from @fsouchu: ghost cars become opaque when you're not touching them

another clip of the racing game: loading a track file and racing against the ghost of its one replay

2DArray,
@2DArray@mastodon.gamedev.place avatar
2DArray,
@2DArray@mastodon.gamedev.place avatar
2DArray,
@2DArray@mastodon.gamedev.place avatar

nicer tire-tracks: old version was 2D lines, new version is mesh-based. the main reason i did this was to get them to be occluded by walls, but they also gained some width variation to make them look a bit messier/dirtier

a car drives around and leaves some tire tracks on the ground, which now look a bit fancier than before

2DArray,
@2DArray@mastodon.gamedev.place avatar

making some campaign-mode tracks - each one has four replays to compete against (bronze/silver/gold/author)

you'll unlock the next track if you get at least the bronze (or silver?) medal. maybe the author-ghosts are only unlocked after you get gold on every track? not sure yet

flipping through some 2D preview of ten campaign-mode tracks. they get progressively more elaborate, and the final track is particularly long and complicated

2DArray,
@2DArray@mastodon.gamedev.place avatar

@donnyglover yeah bronze is definitely feeling like the right move!

in general you can hit a bunch of walls and still beat the bronze times (my strategy for recording those was to mess up every turn at least a little, sometimes a lot) - so getting a campaign-complete screen for all-bronze seems like a good "first bus-stop which rolls credits" to me

2DArray,
@2DArray@mastodon.gamedev.place avatar

trying a different style of wall rendering

"walls are just meshes" simplifies a lot of the code and adds lots of new possibilities, but it also adds a slew of new demands, both in terms of code (LOD, sorting, etc) and aesthetics/legibility. feels promising so far, though

footage of the racing game, but now the super-high walls are replaced with low highway-barriers. they look prettier than before, but are also a bit harder to see at the moment. from certain viewpoints, you can see some incorrect sorting artifacts, where parts of certain walls show up through other walls.

2DArray,
@2DArray@mastodon.gamedev.place avatar

added object-sorting to fix the "inside out" walls (check the right side of the screen in the previous clip to see that) - i haven't mixed the cars into that sorting pool yet, but i'll do that soon

gonna need to figure out some static-object culling to skip faraway stuff quickly...there are a lot of small wall-meshes in a full track

a similar racing-game clip as the previous one, but now the walls surrounding the track have stopped showing a certain sorting-order problem which was visible in the previous recording, so they generally look more correct than before

2DArray,
@2DArray@mastodon.gamedev.place avatar

@fsouchu for now, yeah!!

dunno if i'll be able to keep them...it really depends on how much i can optimize and resist the constant urge to add more-more-more other stuff. lol

2DArray,
@2DArray@mastodon.gamedev.place avatar

@fsouchu that's how the AO already works - but the texture is so very low-res that it's not useful for any high frequency details at the moment! (checker pattern is the tex resolution)

may change at some point but I don't think I can get away with too much, since the ground renderer takes big advantage of the low res (does a lot of "don't re-sample until the next texel" caching inside each screen-row)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines