Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 27 28 [29] 30 31 ... 72

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

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #420 on: July 14, 2009, 02:27:33 am »

Huzzah, I finally managed to get a decent start on my own project.  I might have something to show off this evening if I put some extra effort in it.
It's not really a roguelike, but it uses ASCII graphics with the libtcod library.  Yay for lots of colours!  It also runs in realtime, so I'm worried about it eating too much CPU because of bad design.

I already had to rethink how I was gonna do my procedurally generated background, as just regenning the entire screen over and over kinda hurt the framerate.  (I expected that, I just wanted to see the end result of the generator)
So now I just generate a long background when loading the level and have it scroll past, using a different noise generator would probably speed it up even more.  But I still want my background to be virtually infinite... Perhaps 'breaks' in the level to load the next bit?

My other worry is 'living' entities.  There'll be lots of moving, destroyable objects floating around and shooting at stuff, at the same time creating more of themselves.  I have no idea how to properly work with linked lists in libtcod.  Should I just write my own linkedlist class?

At least I won't have to bother about line-of-sight, except in "sneak missions", but I can just draw a line to see if I'm spotted.  Or just check distance, everyone having a scanner and all.
« Last Edit: July 16, 2009, 05:19:18 am by Rhodan »
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 #421 on: July 14, 2009, 09:34:40 am »

About linked lists:
You can combine them directly with your enemy class, or you can use a struct if you don't need a full class.
A better question would be if you should use a linked list, a doubly linked list, or any other variation(cyclic and stuff), or something other than a linked list.
Logged
Eh?
Eh!

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #422 on: July 14, 2009, 11:13:41 am »

Well, the list will contain every object that can move about, gets drawn and/or has a hitregion.
Since the list will just get looped once during each tick, a list of undefined length where I can add and remove objects from would work well enough.  I think I'll just code my own list thingy, it's easy enough.
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 #423 on: July 14, 2009, 11:17:29 am »

A singly linked list would have everything you need, but removal will require keeping a pointer to the previous one(Not that hard if they are removed from within the update loop), while if you expected to add/remove them at any time a doubly linked list might work a bit easier. Especially on very long lists.
Logged
Eh?
Eh!

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #424 on: July 14, 2009, 04:19:56 pm »

Hmm, if I do the removing in the update loop I wouldn't need a pointer to the previous one.  I can just tag objects for removal, and remember the previous object in the loop, then remove and reattached the objects from within the loop.
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 #425 on: July 14, 2009, 06:47:28 pm »

Exactly.

Also, after learning of a recent feature, BYOND could be used for roguelikes of a sort.

When the resource files are "misplaced", anything that had an icon uses placeholder ASCII.

Naturally, some games won't work like that, but...

Spoiler (click to show/hide)
Logged
Eh?
Eh!

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #426 on: July 15, 2009, 01:49:34 am »

Woo, I'm getting somewhere.
I still have to solve my background issue, though.  I don't like having to wait for it to render.  Anyone know how to continuously draw scrolling perlin noise, generated on the fly without a lot of CPU pressure?
I almost got close by drawing on a new console and blitting it over the root console, then having it scroll past and draw the new noise on the bit that has scrolled by.  It worked partially, the new noise appeared in ugly seperate lines, too far apart.
Just redrawing the entire screen works best, but since I need at least 4 layers of noise it's just too slow.

Could I use one 3D noise for RGB colours instead of 3 2D noises?
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 #427 on: July 15, 2009, 09:15:09 am »

If you can get it to work, draw a screenful to a texture for each layer.
Have two of these textures at once.
When one goes off the screen entirely, generate the next screenfull to it and move it to the front.
That way you only generate one full screen at a time, and only when needed.

If even that is too slow, generate a quarter of it in intervals of 1/5th of a screen moving, and on the last, when it is already done and the screen is ready, upload it to a texture on the graphics card.


Except that, thinking back, this might not work because, though that is how I would do it, I would be directly using openGL. Although, technically, only the upload to graphics card texture part is openGL/similar specific...
Logged
Eh?
Eh!

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #428 on: July 15, 2009, 10:22:57 am »

The thing is, I'm afraid that drawing it screen by screen might cause a brief stutter each time on slower computers.
Splitting it up in smaller fragments is a great idea, though.  I'll try that.  Though I also realized why my previous method of just redrawing vertical line by vertical line had gaps in it.  I'll see what I can come up with.

Another possibility would be looped perlin noise, but is that even possible?  Google suggest extracting a cylindrical shape from a 3D noise in order to make it loop, but that sounds, well, tricky.

Edit:  I did it!  I managed to rewrite the redrawing code.  Now it redraws the part of the console that has scrolled by during the last frame, and properly shows the redrawn part on the other side of the screen, creating an infinite scrolling background.  Well, as infinite as floats can go I guess.  The best bit is that the code doesn't draw anything if no whole line has passed during the frame, so it runs very efficiently.

Here's a screeny for you guys:
Spoiler (click to show/hide)
« Last Edit: July 15, 2009, 05:15:41 pm by Rhodan »
Logged

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #429 on: July 15, 2009, 06:29:47 pm »

Eep, how can I delete a double post?
Logged

Andir

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #430 on: July 15, 2009, 07:37:12 pm »

Eep, how can I delete a double post?
You have a first born child and a right arm?
Logged
"Having faith" that the bridge will not fall, implies that the bridge itself isn't that trustworthy. It's not that different from "I pray that the bridge will hold my weight."

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #431 on: July 16, 2009, 01:26:29 am »

Hmm, not yet.  Gimme 9 months.
No clue where to get the child though.
Logged

Granite26

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #432 on: July 16, 2009, 08:49:03 am »

Looks good Rhodan... Neat concept, and Ascii is definitely the way to go for it.

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #433 on: July 16, 2009, 08:56:18 am »

Yeah, so far it looks great.  I hope it won't get too confusing with lots of enemies on-screen.  But if ASCII Sector can do real-time spaceships, so can I.  (Well, graphics-wise anyways)
Balancing will be a pain, though.  The customization will need a very good balance between energy, cost and efficiency to make Death Stars plausible.
Logged

Granite26

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #434 on: July 16, 2009, 09:19:13 am »

Do you see there being a higher cost for building bigger ships?  (Perhaps something like Counterstrike where you lose parts as you play, and a bigger ship is tough to maintain)

Consider High Power Req auto-turrets for screens with lots of baddies.  It'll feel crazy, but the player will really be focussing on the opposing capital ships with his main guns.  (This for Death Star battles, of course)
Pages: 1 ... 27 28 [29] 30 31 ... 72