So, Cymon's games has inspired me to try my hand at textmode games. I will write throwaway test programs and hopefully work towards something interesting.
Throwaway Test program 1: It's a start, I guess. You can move around a boring room and talk to a single NPC (and harass him, if you try hard enough). You can also edit the board by pressing forward slash, and load/save the board to a text file.
The next one will have an actual game objective! And win/lose states! what the hell am i doing
Attachment | Size |
---|---|
textmode_throwaway_test_program_1.zip | 64.64 KB |
Comments
Oh HELL YES. This is
Oh HELL YES. This is inspiring. I need to step up MarMOTS development if I'm going to compete with this.
I'd love to sneak a look at the source code. I've poked at curses a couple of times but never really got anywhere.
Sauce code
Here. It's all crammed into one messy file, editing/playing functions are inter-mixed, no malloc() ... things I want to correct next time.
Throwaway app 2 will be a
Throwaway app 2 will be a sort of platformer.
Wasted yesterday trying to find out if PDCurses can show the additional IBM glyphs (Because Code Page 437 is inherently funny), and attempting to get some things like init_color() and color_content() to work. I should have just focused on making a game...
All the AAAAAA's of the rainbow:
To use colours, you have to initialize foreground/background pairs. Small problem: the leftmost A's are too bright (they are supposed to be black-on-black and darkgrey-on-black).
Wasted more time on stupid
Wasted more time on stupid crap yesterday. Couldn't get malloc() or free() to work properly. Switched back to #defined array dimensions.
I don't have a board-loading function or a level editor yet, but the player will eventually hop around like this (instantaneous, no animation):
The game will be about eating sandwiches. dropping too far will cause butt damage. Starvation, touching mines, or fatal butt damage will take a life. Each sandwich increases the distance of your jumps. I'm thinking ... 9 levels. Here's a WIP, mainly to prove to myself that I can keep doing a thing for a while without shelving it.
controls are on the numpad: 1 and 2 to walk, 46789 do various jumps.
I'm really digging the
I'm really digging the instantaneous jumping. When I saw your diagrams, I had no idea how it would work, but of course drawing the jump trail on the screen makes perfect sense.
anoter wip
The programming is finished for the most part. An ending check is broken, but everything is in place except for level content. I have no idea what to do for levels, but slapping the program together was good practice. Before this, I had never written more than a few lines of C.
This is really pretty cool!
This is really pretty cool! :)
I could see it turning into some sort of tactical / rpg /platformer hybrid. xD
this reminds me of the game
this reminds me of the game with no name.
(not the ds one.)
I tried to play that a while
I tried to play that a while ago, during the time when computers were too fast for old games and before DOSBox was omnipresent. I still have no idea what the correct speed is.
It's good when passwords are actual words. Today's password is sequencer
Speaking of old texty stuff, I'd like to make something like Castle Adventure.
malloc() was crashing
malloc() was crashing because I wasn't casting the pointer correctly(?). Seems okay now.
Does this crash when you exit (either by clicking the close button or pressing q)? That's what happened before.
malloc
I was an embedded C programmer in a former life. Your problem is almost certainly memory corruption -- likely writing to already freed memory, but possibly also writing past the end of allocated memory (off-by-one array allocation, for example) -- and is probably still lurking. A bad cast would have to be bad enough to mangle the pointer somehow so that even _reading_ from that address would cause a segfault.
Attach or PM me the source, I'll find your bug.
VERY GENEROUS OF YOU
The crash was in an older version of the jumping game that I no longer have, wherein I tried to allocate 2D arrays. Specifically, the Microsoft apology box appeared when I tried to free the arrays.
Knowing me, I probably borked something in this program, too.
here is the source for the
here is the source for the jumping game, with allocation re-added. the allocation/freeing is around line 206
I don't see anything wrong
I don't see anything wrong with the first program.
As for the second program, some random thoughts:
- As written, there's no need to use malloc at all; saying "int map[SCREEN_Y][SCREEN_X];" and "int mapStore[MAX_STORED_MAPS][SCREEN_Y][SCREEN_X];" would work just as well.
- There's no reason to free a pointer that you know is null. ("if (x == null) { free (x); return 1; }" can become "if (x == null) return 1;")
- Rather than doing checks every time you access your map with coordinates that might be out of bounds and inevitably missing some places, write a function to do it for you and return A_WALL if the coordinates are invalid. (For an example of where this might be handy, run your game in a debugger, get to level 2, hit 0 before moving, and see where it crashes :)
- Maybe do something like, "typedef int[SCREEN_Y][SCREEN_X] map_t;"? "int ***" is a scary type, man. Then you could have the number of maps saved in boards.txt, and allocate mapStore with "malloc(sizeof(map_t) * nMaps)".
I'm not seeing any places where you're writing over the bounds of map or mapStore; you're mostly doing bulk copies rather than realtime map manipulation and so the potential for error is small, and if you DID mess that up, it would probably show up in other ways (sideways levels if you swapped SCREEN_Y for SCREEN_X in one of your loops, say). I haven't gotten it to crash on exit, so good show there.
Level 4 is mean, but also kind of awesome.
Thank you for inspecting my noob code.
:O
also, yes you are absolutely right, int *** is scary as hell
getting there
Added a collision/bounds checking function, removed malloc of map arrays
On second thought, starving to death sucks. I will replace it with a turns counter. Health seems pretty redundant too, since to do any interesting levels I need to keep feeding the @ sandwiches to increase its jumping distance -- damage is inevitable.
I need to make three more screens.
changed the jump guide so
changed the jump guide so that it doesn't obscure the mines and sandwiches
I think that's about it.
what i doesing
I feel like making something along the lines of Castle Adventure
Q: What is a Castle Adventure?
A: Well, (leaning on a tree stump), it's a mysterious text-based oddity from 1984. You're trapped in an old castle, and the only way to open the front gate is to steal treasure (at least I think that's what you do). All areas are persistent and combat plays out in real time. You can also type in basic verb-noun pairs to make your character do stuff. Your health is mysteriously never shown to you.
Mysterious!
...
I think I will avoid real-time combat, and forego verb input for situation-specific hotkeys. Basically I just want to make a short adventure game, but whenever you do something in text mode you have to explicitly say that it's not a roguelike.
*** NOT A ROGUELIKE ***
I need ideas for the setting and plot, though. might stew on it for a while. The easy solution would be to make it a "trample through a wacky house" game, but I already drove that into the ground in ZZT. Maybe Area 51? Or something along the lines of the Lone Ranger.
Working on an ascii artboard
Working on an ascii artboard editor/viewer (for the game mentioned above).
I miss the other cursors frantically drawing stuff in MarMOTS. My artboard is 500% lonelier.
It's one of my missions this
It's one of my missions this week to get MarMOTS back online. I was up until 1am last night squishing bugs in my persistence code.
I haven't posted much
I haven't posted much lately. Forgive me, komrades!
I completely forgot about the PDCurses adventure and instead futzed around with SDL. I don't have much to show for it, just a simple tilemap editor and an ultra-basic platformer walkabout demo. I'd like to get collision detection working, but I need to be able to load tilemaps into the walkabout blah blah blah I should make a KNP game.
you've abandoned text mode
you've abandoned text mode but not the happy garishness of old dos games
make more games qrleon
Those were the daaayyyyss
This makes me think back to the times of school computers and DOS shareware games menus.
This looks gorgeous. I
This looks gorgeous. I adore the idea of extending the 4-colour CGA palette by changing the brightness, rather than adding different colours.
4reelz
It looks totally legit too.
The graphics were from an
The graphics were from an old mockup that was intended to look like a super-gaudy DOS EGA game. I planned it as a nonlinear maze platformer, but if I made it now, it would be a straight shooter.
the whole mockup if you're curious
Fabulous!
Fabulous!
Tubular!
Tubular!
rhinoceros
rhinoceros
pretty dang neat
pretty dang neat
Thanks
I have two platformer ideas at the moment, one I'm super excited about and one that is lazier but would be easier to build. These pics are from the latter; I'm not fit to make the other one yet. A high framerate, vsync, and smooth scrolling are prerequisites... this one should be okay @ 30 frames per second with no scrolling.
im slow progremmer
The screen editor has almost everything I want, except for copy/paste/import/export, and some hotkeys for certain tiles. Very similar to ZZT, I guess.
Still no actual game engine. :-)
Got inspired enough this
Got inspired enough this evening to finish the map program. My implementation of layers was bad, and I had to write some lame repetitive code to make it all work.
I finally have a "walk
I finally have a "walk around an empty room" mockup.
Enclosed is a Windows binary. Let me know if it explodes.
S: jump
A: shoot
Hold S: charge
A + S: float
It exploded!
I think it game me a blue screen, then my computer reset. This is in Vista, before I saw the program open. There were other things running, so I'll re-try when I get the balls.
Damn, I wonder what could
Damn, I wonder what could have caused a blue screen? I hope you didn't lose important stuff :(
Works fine for me in Vista!
Works fine for me in Vista! Solid physics. I'm digging the floating mechanics.
D:
It happened again. The program started, the sprite dropped don, and when it touched the ground: Blue Screen. It was up for a while, but I couldn't tell what the actual problem was.
Didn't lose anything, either time.
Shit...
I don't have Vista, so I can't test it. Sorry for the crashes dude/dudette, I really hate blue screens. If you can run KNP, here's a mockup from a while ago (with a couple of extra things).
Also, what are your system's specs, just out of curiosity? 32 or 64 bit? multiple cores? do you have a video card, or integrated graphics?
System specs:
Acer Extensa 5210
Celeron M 520 1.60 GHz
1GB RAM
Integrated Graphics (Mobile Intel 945 Express)
Windows Vista Home Basic
32 bit
Excuse me if any of that's a bit wacky. I haven't been clued into computers for 10 years.
Let me know if you need anything more specific. There is a crash log, just not sure how to show you it / what of it to show you.
That's kind of insane. A
That's kind of insane. A regular ol' C program really shouldn't be able to bluescreen a Vista machine. If I had to guess, I'd say there's some kind of video card driver bug at work.
qrleon, as always, I'm happy to look at your source code for memory corruption bugs, if you'd like the help.