Tuesday, April 16, 2013

Excellent articles

I thought I'd post these two links here.  Very much worth reading!

RPGs and Procedural Content Generation

Care and Feeding of Software Engineers

As of today I am now homeless.  Once I get back into a more permanent home (which is in the works) I will start iterating on some of my content I've posted here.  Until then.

Thursday, April 4, 2013

Quick update (again)

Things have been busy, and life has been near all-consuming.  I have spent a couple of hours on the RPG textbox code, but have run into some snags with cocos2d 2.x and TTF fonts.  So it's getting there but not there yet.  Sorry for the delay.

I did run across this link this morning which looks very good for menuing in a game using cocos2d and thought I would share.

I have also had a few email questions about collision and the TMXGenerator code I have posted on this blog.  I would like to direct those who are looking for examples to check out either the base cocos2d-extensions example, which includes collision detection, or to have a look at Ray Wenderlich's write-up about creating a tile-based game with cocos2d.

Until next time.

Sunday, March 3, 2013

Quick Update

I just wanted to drop a note in here to mention that I've not abandoned you all.  I've recently started a new job and am possibly moving in the near future.  Needless to say I've been pretty busy and haven't done much in regards to my hobbyist coding.

That said, I have been considering releasing some source that I have done last year for a RPG text box in cocos2d.  This thread being bumped reminded me that I wanted to do that at some point.  So if I get some time in the next week or two maybe I'll clean up that code into a sample project and release it here.

I'd still like to get back to the maze stuff soonish as well.  I keep wanting to get house style layouts auto-generating and fixing some of the bugs up that are in there.  As well as maybe making a settings for the random maze generator.  Guess we'll see.  =)

Tuesday, February 5, 2013

We love source!

So I'm pretty stressed today.  To try and alleviate some of that I thought I'd put out there some of my code for the auto-drawing app that I have done.  You can consider this code to be under this creative commons license.  Have a look and be inspired.  Or laugh at my older cocos2d skills.  It's a little dated, but still works pretty ok.  Maybe someday I'll update and take this project to the place that it really ought to go.

You can get the code here.


Saturday, February 2, 2013

Busy!

I want to apologize to anyone following along or waiting for some code changes.  I've been somewhat busy lately with real life stuff.  While that may not entirely go away, I hope to have that let up some here soon.

I have started kicking around an idea I've had for a while, which is to make a MUD style game in ruby.  Mostly to learn ruby, but also because I've always liked the idea of MUDs (and MUSHes, a good friend of mine had a MUSH on his BBS back in the day.  Yes, I'm dating myself with that one...)

Since this is a game dev blog I'll post the brief outline I started the other night.  It's by no means complete, but it should be a decent starting point and a place to collect my thoughts.  Assuming I get anywhere useful I'll put a github link to the project here.  For the moment I only have a text parser that understands help, quit and parrots your input back to you.  Yeah, it won't be winning any awards anytime soon...

Anyhow.  Enough of that.  On to the outline.


Synopsis:
A world exploring/building text adventure style game.  Players can discover pre-made worlds as well as
create their own world.  Should be a good tutorial/intro as well.
Note: this is probably crazy ambitous for a starter ruby project (past a hello world app)
*--------------------------------------


Currently working on:
- database persistence in sqlite3 (https://github.com/luislavena/sqlite3-ruby)


Bugs/Todo:
*--------------------------------------
- typing anything with 'quit' in it will quit the app, even if it's in a sentence.
- Lila says it needs moar kitties.


Pieces
*--------------------------------------
- Update the interpreter
- Add help to the interpreter.  Make this basic, but interactive.  Above all descriptive.
- add basic vocabulary that does stuff.
- look (examine), move, take (carry, hold, get, steal), say, [more]
- Add a basic tutorial
- Add a (less basic) tutorial.
- Add a basic world with a cheez-ball story.  Maybe reminiscent of king's quest 1 / space quest 1?  (but not as elaborate!)
- Add player object specifics and customization
- Add multiplayer via a server model that multiple clients can coonect to.
- bonjour would be cool for connecting here.  looks like dnssd is the gem for this.
- Also whispering and possibly in-game emails?  Too much?


Objects
*--------------------------------------
- All objects should have a parent, owner and creator.  Default owner is the room the object
is created in, no parent, and creator is the player.

- objects can have attributes.
- attributes should have passive triggers.  i.e. 'steal bread' should not broadcast
to others in a room that a player is taking the bread.
- should objects have a material type/types?  (this would help with world behavior.  Wood burns, stone does not, etc)
- for multiple types, if one is destroyed the object is destroyed?  i.e. a wooden shield with steel studs falls apart when burned
- players should have a custom range of attributes.
- Intelligent monsters could be an alternate computer controlled player, that have their own agenda and motives.

- Add basic infrastructure (API) which is defined as:
- portals/doors
- to other objects.  (objects can be rooms!)
- doors should have their own description, or the user should pick material type.
- We should at LEAST have a standard door that is the default.
- event triggers
- Design triggers.  How do they work.  What events can trigger them?  What can players add or not add?  Can we actually have players add ruby code to meaningfully interact with the world?
- initial thought - triggers should be proximity based (passive), or directly activated (active)
- passive triggers modify the connected object.
i.e. if you are carrying a magic glowing rock you have light around you as a passive effect.
- active triggers can be one-time or continuous.
i.e. turning on a flashlight is a one-time event that maybe activates a passive effect.
i.e. breaking a vase would be a one-time effect.
- custom object methods
- ideally these would be persisted DB objects that can have custom methods.
- thinking some built in actions (teleport to certain places, lloyd's beacon, opening, closing, destroying, etc) would be ideal as an API that makes objects with custom lego-like constructed methods.
- possibly triggers could have some form of ruby to make them very powerful?  How much would we have to expose in order for this to really be useful?  Is that a good idea?




Saturday, January 12, 2013

More mazes??

I've done a few things here and there, but very little in the past week or two on my hobbyist projects.  Today I sat down for a little while and fixed a couple of bugs as well as added a random menu item to the code.  So you can both re-seed the current settings or have the program generate new settings.  I'll update the code at the github repo.

I created a project to start exploring internal building layouts but haven't done much other than migrate some stock code to it.  I will hopefully get to that soon.

For the curious, I had a few out of bounds coordinate bugs that I found as well as a crash on startup the very first time you ran the code.  I also messed around with door to room generation but didn't really get what I wanted to done there.  I hope that rooms will more often have doors to more walls before doubling up, but it's hard to tell with corridors punching through walls sometimes.  Anyhow.  Too much to do, not enough time to do it.

Happy weekend!


Monday, December 31, 2012

Mazes continued

Apologies for the outage, I have been sick for the past few days.  Little has been accomplished since late friday evening.  However, I did get some good coding in that evening and would like to share some of the results with you.

Before that though I would be remiss if I didn't give a nod to Jamis for his great blog about mazes.  I had my implementation done before I saw his page, but it's definitely a fantastic resource, and helped me flesh out my understanding of what I am doing.

Anyhow, shortly after my last post I went after making rooms.  Rooms turned out to be harder than I expected.  I first tried to make random rooms placed randomly around the map, allowing for overlaps. That didn't work out as well as I'd hoped.  I added some collision detection of sorts to the random placement of rooms as well as boundaries between rooms and the results were much better.  Once I had the rooms more or less placed as random rectangles, I moved to making 2 to 4 exits per room.  At this point I switched the depth-first algorithm to be after room generation and it very nicely made corridors between the rooms.  (You are in a maze of twisty passages all alike!)  Finally I added code to the corridor searching to say if they had found a room exit or not.  If they did not then they were "trimmed" and re-filled, leaving the larger dead-ends out.  There are still dead ends because of the way my code works though--any dead end that branches off of an exit gets kept.  That will need to be addressed.

Here are some pictures, both with and without the dead end trimming.



I like the overall look with the dead ends intact.  However for the project I'm doing I think I'd like to trim all dead ends as well as make the corridors straighter (rather than randomly turning at every possible juncture).  I'll probably work on that some tomorrow.  In addition, better odd shaped rooms would be useful here as well.

I also dropped my room code over the top of the caves project I did a bit ago and changed the tiles so the rooms were slightly different.  Just for fun.  There could be uses to a mixture of these two methods, though this is very rough.


As usual, the source to the new maze with rooms can be found here.

Edit:  Added with additional code to a github repo by request.

(Comment out lines 267-268 in DungeonLayer.m to stop the dead-end removal.)

More later!