Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 34 35 [36] 37 38 ... 72

Author Topic: The Roguelike Development Megathread  (Read 245621 times)

Taroc

  • Escaped Lunatic
    • View Profile
Re: The Roguelike Development Megathread
« Reply #525 on: November 27, 2009, 01:50:44 am »

I have totally no clue how to code or program anything. I was wondering the best way for someone like me to learn to code that starts with teaching the VERY basics.
Logged

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: The Roguelike Development Megathread
« Reply #526 on: November 27, 2009, 09:26:27 am »

It depends... there's a lot of programming languages you can use.  I can recommend you C++.  You'll have a lot of documentation and examples in the web and it's a competent language that allows you to do a lot of things.

If you can learn from the internet, I suggest you take a look at the c++ tutorial in my link.

Getting a book is always a great idea if you're sure it's not just a one day thing...
http://www.gamedev.net/columns/books/

You can always ask for support in programming forums _(even here, there's some people willing to help with what they can)
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: The Roguelike Development Megathread
« Reply #527 on: November 28, 2009, 12:24:07 pm »

Ideally, what is the minimum a roguelike must do?

Draw and manipulate a grid of monospaced text, and accept full-keyboard input from the user.

Aside from that, you can do anything. You can even disregard those as well, and do it your way, such as by adding graphics or have the only input as voice recognition from the microphone.


But, most roguelikes work with keyboard input, and at least partially a monospaced display grid. Most roguelikes keep an array for the level other than just the display text. Most roguelikes have a class or struct type to represent creatures and/or items and/or tiles, etc. Most roguelikes have some varying form of permadeath. And so on.

Keeping your level data independant of your creature data, and independant of your item data, and independant of your display data will be useful for later expansions. It is easier to move a creature pointer between tiles than actually copy the creature's data into the new tile and clear the old one.
Logged
Eh?
Eh!

Taroc

  • Escaped Lunatic
    • View Profile
Re: The Roguelike Development Megathread
« Reply #528 on: November 28, 2009, 08:08:10 pm »

Thanks for the help. I am hoping this isn't a one day thing but I'll check out those tutorials before buying anything. It's something I've always thought was interesting and wanted to learn.
Logged

ductape

  • Bay Watcher
  • MAD BOMBER
    • View Profile
    • Alchemy WebDev
Re: The Roguelike Development Megathread
« Reply #529 on: November 28, 2009, 10:34:30 pm »

If you are just starting out and have no experience programming, Java and especially the Processing implementation (library) can be really fun and educational.

Now, I am sure many people will tell you not to use Java to make a roguelike, and that may or may not be good advice. There are some examples of roguelikes in Java, such as CastlevaniaRL, Wayfarer, and the rebuild of ADOM (in development). That being said, it is widely considered wiser to choose a more robust language like C or C++

However, Processing can be a great way to learn the basics of object oriented programming and from there you can dive into C++ or maybe even Python. Personally, I really like Java and most of the problems people complain about are going away or have gotten better in recent years. Java was built with ease of programming in mind and can be a joy to work with compared to the options.

Processing is an open source programming language and environment made for artists, hobbyists, and students. Processing is Java wuth a bunch of handy libraries attached and an easy to use programming interface. Wayfarer is actually a roguelike built with processing.

Here is a link to the Processing website:
http://processing.org/

Try these fun Processing tutorials:
http://processing.org/learning/

Here is a link to Wayfarer:
http://benhem.com/games/wayfarer/


Logged
I got nothing

Jookia

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #530 on: November 29, 2009, 02:19:43 pm »

I've been so annoyed at this darn C++ OpenGL code and all I want to do is a tiled array to the screen. Like in Dwarf Fortress. But I can't find any way to do this. I tried using Windows' wgl but the font size is different depending on each character.
Logged

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: The Roguelike Development Megathread
« Reply #531 on: November 29, 2009, 02:46:01 pm »

Seen the Tacticus game?

I posted a program that might be exactly what you are looking for, at least as an example, with source code.

It uses an old copy of DF's tileset, back when it was a .bmp, and I think there is a dangerous lack of bounds-checking on the colour fill function, but it a) uses OpenGL and the win32 API, b) draws a grid of coloured text.
A feature I left in was that all images are stored as both the graphics data and an OpenGL texture, updating to the texture if it has changed since last being drawn, making the only code needed to draw the entire "map" the code to draw a textured quad. If you wanted, you could even use it to run a roguelike as a texture on a computer monitor in a 3D FPS as a minigame...

Alternatively, you can render a grid of textured quads, coloured to the tile colour, with the character as the texture's location, though you would need two passes, one for the background and one for the characters themselves.

An early effort of mine used an OpenGL command for drawing a "bitmap" (literally, a series of bits detailing transparency) in a colour, over a background quad, but transfering all that data was slow, and simply using a texture would speed it up greatly.
Logged
Eh?
Eh!

Jookia

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #532 on: November 29, 2009, 05:35:57 pm »

I want something that's possible on all platforms. I'm happy to do wrapper code and messy stuff.
Logged

strich

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #533 on: November 29, 2009, 06:40:57 pm »

I'm learning C++ because I want to do more than just a roguelike, but if that is all I was going to do I'd definitely choose Java as the preferred language. Its simple, capable and a modern OO language, and you can easily run it in a number of cool environments (As an app, on a website, phone, etc).
Logged

Mipe

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #534 on: December 07, 2009, 07:17:09 am »

I am learning Ruby and as part of this process I have decided to develop a roguelike on my own. For this purpose I have done some research and this is what I came up with:

- Ruby 1.9.1 (much higher performance than 1.8 branch) - simple language that gives you immense freedom
- Gosu 0.7.15 - ruby library designed for game development, it has the basics that eliminate the hassle of programming hardware calls

There were other options, such as modding an existing roguelike engine, however I decided it was time I learned a real programming language. I also looked at The Doryen Library, however it appears that there is no ruby implementation yet. I'd have to hassle with stuff like SWIG, which kinda defeats the goal of keeping it simple.

Since I am a beginner, I am pretty much still in the figuring Ruby out stage before I can produce something functional. However, I already have a plan:

- display code - down to the basics, it would draw tiles onto the screen; I plan on using a tileset containing extended ASCII codes (much akin to Dwarf Fortress, which of course is my inspiration)
- input code - still have to figure out how to record key presses and process them

Once the above is figured out, that would get technicalities out of the way and allow me to focus onto the game itself. The goal is to have a solid display/input engine that would be independent of the actual game engine. This would also allow for the possibility of porting; the abstracted output/input would mean custom display/input options, such as console controllers or even handheld implementation.

However, I am still very much green behind my ears, so I am keeping it very simple at this point, yet still abstracted. Any tips would be greatly appreciated!
Logged

dephbokks

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #535 on: December 07, 2009, 03:28:00 pm »

I am learning Ruby and as part of this process I have decided to develop a roguelike on my own. For this purpose I have done some research and this is what I came up with:

- Ruby 1.9.1 (much higher performance than 1.8 branch) - simple language that gives you immense freedom
- Gosu 0.7.15 - ruby library designed for game development, it has the basics that eliminate the hassle of programming hardware calls

Sounds good. I wasn't familiar with Gosu, but I checked out their site and it seems decently documented and still being actively developed (latest changes were today).

There were other options, such as modding an existing roguelike engine, however I decided it was time I learned a real programming language. I also looked at The Doryen Library, however it appears that there is no ruby implementation yet. I'd have to hassle with stuff like SWIG, which kinda defeats the goal of keeping it simple.

One suggestion is to learn the language by itself before delving into game programming. If you are learning a language as well as a library/engine/API simultaneously it may make things harder. I'm not saying to go hardcore, but having a working knowledge of the language helps greatly for when you want to make a game.

Since I am a beginner, I am pretty much still in the figuring Ruby out stage before I can produce something functional. However, I already have a plan:

- display code - down to the basics, it would draw tiles onto the screen; I plan on using a tileset containing extended ASCII codes (much akin to Dwarf Fortress, which of course is my inspiration)
- input code - still have to figure out how to record key presses and process them

Once the above is figured out, that would get technicalities out of the way and allow me to focus onto the game itself. The goal is to have a solid display/input engine that would be independent of the actual game engine. This would also allow for the possibility of porting; the abstracted output/input would mean custom display/input options, such as console controllers or even handheld implementation.

That's what I always tell beginners of game programming. Get a sprite on the screen and make it so the user can move him via keyboard inputs. It's like the Hello World! of game programming. Also getting the framework set up is usually easier than the actual programming of the game. Adding content and getting it to work in a balanced manner is a more difficult job.

I saw a quick tutorial on the Gosu page that does just that. So basically you'll load up your whole ascii tileset and then clip out the required character and blit (bit block transfer) that portion of the spritesheet to the screen.

One last suggestion. You may want to switch to python as the language:
  • It has a similar syntax to ruby and you are not the far along with rubby.
  • It has libraries like Pygame and Pyglet that have large communities.
  • It has bindings for the doryen library.
  • It is more popular - comes standard on Linux installs and I think Mac - thus there are more support, users, code base.
  • Professional game studios use it extensively as well, Civ IV for example.

But the language choice is not that important for the beginner since you'll likely start learning more languages as you progress. Two years ago I only used C, C++, asm and now I added C#, Java, Python, actionscript so you'll see that they're all really easy to pick up once you understand programming.

Good luck it sounds like you have a good head on your shoulders and are attacking the problem in an intelligent way. One last thing for programming help gamedev.net is a good resource.
Logged

ductape

  • Bay Watcher
  • MAD BOMBER
    • View Profile
    • Alchemy WebDev
Re: The Roguelike Development Megathread
« Reply #536 on: December 07, 2009, 03:33:27 pm »

I would second Python also. If you want web deployment, check out Django!
http://www.djangoproject.com/
Logged
I got nothing

Mipe

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #537 on: December 08, 2009, 02:18:01 am »

Thanks for the tips!

I decided to stick with Ruby, even if it doesn't have the same level of support as Python, it still offers me great level of freedom. I dabbled in Python a couple years back, was left overwhelmed. Perhaps it will be easier once I am done with Ruby. Don't worry - I already am familiar with game design, as I am an user and tester of Construct. I would have used it for roguelike, however I wanted to learn a programming language.

With help of programmer friend, I've finished the tileset bit - basically it takes the tileset, in my case I chose one of DF silesets, then loads tiles into an array of images. Additionally, a hash is generated from symbols, that represent something (such as :heart, :diamond, :spade, :club) and zipped with the array of tiles. Pronto! I just call :heart and it returns the heart tile!

With this, display will be very easy to code. Since Gosu clears the screen with each frame, everything would have to be redrawn, so I'll just use a buffer containing symbols. Each tick it would go through each cell of the buffer and draw the tile referenced by symbol in the hash. It's easy! I'll want to add some methods for drawing interface, though. The buffer would then be used only for the actual game view, camera-like, while the rest of interface could be drawn with empty spaces in between (such as space between lines of text). I'll probably want to come up with a context-sensitive interface.

Finite state machines rock.
« Last Edit: December 08, 2009, 02:20:43 am by Mipe »
Logged

Xombie

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #538 on: December 08, 2009, 09:07:03 am »

how do you make an .exe with ruby?
i was trying all kind of stuff for like a hour

i got ruby-1.9.0-mswin32

all ruby sites saying how it's simple and accessible for any moron and then generic "hello world"-section with basic-like code.

maybe its some kind of anti-gaijin protection?

Also hows performance? From my experience simple languages tend to be slow.
Logged

Mipe

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #539 on: December 08, 2009, 10:41:04 am »

http://ocra.rubyforge.org/

Works with Ruby 1.9.1. As for performance, well, it is able to draw 16x16 tiles all over 1024x768 window without any performance loss. I did a test; it can handle 9500 concurrent objects on the screen (up to 64x64, larger objects cause considerable drop) without going below the default 60 FPS.

However, that is not an issue for roguelikes. It is the game engine itself that I want to test the performance of and it has yet to be developed. ;)
Logged
Pages: 1 ... 34 35 [36] 37 38 ... 72