Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 16 17 [18] 19 20 ... 72

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

Rhodan

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #255 on: February 03, 2009, 03:59:25 pm »

Perhaps make it a general ability to pick up and throw opponents?
Logged

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: The Roguelike Development Megathread
« Reply #256 on: February 03, 2009, 08:25:53 pm »

I didn't feel like programming today. A bad omen, my friends. A bad omen indeed...
Logged

Andir

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #257 on: February 03, 2009, 09:07:48 pm »

I didn't feel like programming today. A bad omen, my friends. A bad omen indeed...
Welcome to my everyday...
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."

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: The Roguelike Development Megathread
« Reply #258 on: February 03, 2009, 10:06:12 pm »

This is more random advice for living in general, but the way I make myself more productive is...  Get all the necessities of life (bills, etc) done early, so when that sudden productive mood strikes, I CAN code and won't be so busy I have to put it off!

Coding is one of those things where you're either in the mood for it or you aren't...
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: The Roguelike Development Megathread
« Reply #259 on: February 03, 2009, 10:08:56 pm »

Should I program even if I'm not in the mood for it? I do it for fun, but I don't want to be lazy. I guess it would become like work then, but, if I don't, I'll probably never finish a game.
Logged

Dasleah

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #260 on: February 04, 2009, 03:03:16 am »

Should I program even if I'm not in the mood for it? I do it for fun, but I don't want to be lazy. I guess it would become like work then, but, if I don't, I'll probably never finish a game.

My aim is to type at least 10 (working) lines of code a day. It's not much, so it doesn't feel like work, and even if it's not what I'm supposed to be doing, it's at least something. Right now, for instance, I'm really enjoying doing terrain generation, and that's tiding me over until I can gather enough enthusiasm to do the player stuff. And in the process I'm learning some things that will be handy when I do get around to what I'm supposed to be doing.

The thing is, the second you start making excuses is the second your project begins to die. You'll start saying "Oh, I'll just take today off because I'm not in the mood", and then it'll snowball and you'll start only coding when the mood strikes you, and then the mood won't come at all and you've lost all your momentum and inspiration.
Logged
Pokethulhu Orange: UPDATE 25
The Roguelike Development Megathread.

As well, all the posts i've seen you make are flame posts, barely if at all constructive.

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: The Roguelike Development Megathread
« Reply #261 on: February 04, 2009, 12:43:22 pm »

And then you chuck yourself into lava...if the fortress is lucky.

I'd be cautious about implementing big new ambitious features when you're not really in the mood.  Not in the mood is great for "Huh, how come it doesn't redraw correctly at the side of the screen", or "Why don't I add a couple new types of elf, that explode when thrown".

It's not always a great idea to say "I think I'm going to start implementing my job and task system now, even though I don't have a great plan for it".
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: The Roguelike Development Megathread
« Reply #262 on: February 04, 2009, 01:00:33 pm »

Right now I have enough to do. So far I've been putting all the map handling stuff into the Game class, so I'm starting work on a Map class. I also need to decide how the Viewport class is going to interface with the new Map class, if at all. I was thinking of passing the Viewport class a pointer to a Map object so the Viewport can return all of the visible objects too.
Logged

Granite26

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #263 on: February 04, 2009, 01:19:49 pm »

Right now I have enough to do. So far I've been putting all the map handling stuff into the Game class, so I'm starting work on a Map class. I also need to decide how the Viewport class is going to interface with the new Map class, if at all. I was thinking of passing the Viewport class a pointer to a Map object so the Viewport can return all of the visible objects too.

Drawing Class diagrams is your friend.  It's a good way to write pseudo code when you don't feel like real work.

As a recommendation, I would have the Viewport class access the 'get visible objects(x1,x2,y1,y2) function and then parse it.

Should Viewport ever need access to things that aren't visible?  (Also, GetVisible(5,5,4,4) is a good 'k' emulator)  That way, the Viewport can manage all the LOS, lighting distance and special senses functions, but 'can I detect it' and 'is it visible' is still handled elsewhere.

Andir

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #264 on: February 04, 2009, 03:16:12 pm »

Right now I have enough to do. So far I've been putting all the map handling stuff into the Game class, so I'm starting work on a Map class. I also need to decide how the Viewport class is going to interface with the new Map class, if at all. I was thinking of passing the Viewport class a pointer to a Map object so the Viewport can return all of the visible objects too.

Drawing Class diagrams is your friend.  It's a good way to write pseudo code when you don't feel like real work.

As a recommendation, I would have the Viewport class access the 'get visible objects(x1,x2,y1,y2) function and then parse it.

Should Viewport ever need access to things that aren't visible?  (Also, GetVisible(5,5,4,4) is a good 'k' emulator)  That way, the Viewport can manage all the LOS, lighting distance and special senses functions, but 'can I detect it' and 'is it visible' is still handled elsewhere.
Viewport should return a 2D array of references to the map tiles requested by it.  It doesn't actually return visible/non-visible flags unless they are a part of the tile data.  You can then pass the resultant array to a renderer, LOS calculator, fire spread calculation, or any other part of the program that needs a limited scope area {x1, y1, x2, y2} view of the map.  The renderer would determine if the tile/creature was visible by the data contained in the tile it's processing at the time.

The player would reference a LOS method to get their view and pass it to the renderer.  The LOS class will grab a limited view of the map... like so:
Player > LOSClass > Viewport > Map

player.setLocation(x, y);
myRenderEngine.render(player.getViewable());

As far as the whole "what has inventory?" question.  IMHO, everything could have inventory capable of a specific number, weight or total volume of items.  Worlds contain X number of regions, regions contain X number of districts, districts hold X number of maps, maps hold X number of tiles, tiles hold X number/volume of items/creatures, people can hold X number of items (weapons, armor, backpacks...) , items can contain X number of other items (gems, weapons, adornments...).

At least, that's what I'd do.
« Last Edit: February 04, 2009, 03:40:28 pm by Andir »
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."

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: The Roguelike Development Megathread
« Reply #265 on: February 04, 2009, 03:20:42 pm »

Let me throw an idea out there...  I'd suggest Viewport not actually create a new array of pointers, coordinates, or anything else.  Seems reasonable that it could simply act as a wrapper... you ask it for tile(2,3) and it adds those to whatever offset to return you a pointer to whatever's there, and does bounds checking.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: The Roguelike Development Megathread
« Reply #266 on: February 04, 2009, 03:24:46 pm »

There seems to be many ways of doing this. I'll have to do some thinking.
Logged

Andir

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #267 on: February 04, 2009, 03:51:02 pm »

Let me throw an idea out there...  I'd suggest Viewport not actually create a new array of pointers, coordinates, or anything else.  Seems reasonable that it could simply act as a wrapper... you ask it for tile(2,3) and it adds those to whatever offset to return you a pointer to whatever's there, and does bounds checking.
That's an array of pointers... if you want a viewport from (12, 56)-(36-75) you'd request (12, 56, 36, 75) and it would return references to those tiles.
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."

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: The Roguelike Development Megathread
« Reply #268 on: February 04, 2009, 04:19:26 pm »

Why make an array of pointers, when you can overload operators or just write a function and do math to retrieve a pointer each time you request a tile instead?

That way, you don't have to spend the time to allocate a dynamic two-dimensional array and then fill it with data. 
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Andir

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #269 on: February 04, 2009, 07:05:06 pm »

Why make an array of pointers, when you can overload operators or just write a function and do math to retrieve a pointer each time you request a tile instead?

That way, you don't have to spend the time to allocate a dynamic two-dimensional array and then fill it with data. 
Oh... you're talking about overloading () or creating a helper class to overload [][]?  I just figured that might be a bit much for someone building a Roguelike for a first project.   ;)

But sure... You could do that as well, but why would you do that instead of just referencing the map?  I suppose if you wanted to do the bounds checking and return a null value or a "flag" value to tell the underlying task that it is at it's limit but even with that the algorithm could do it's own "distance" or bound checks.  I'm just having a hard time finding a use for it right now...  The point of the viewport was to give the method on the receiving end a small dataset to manipulate.  (you could also do locking with construction and destruction of the resultant array...)  Anyway, yes... more efficient than making a temporary array, but for what?

Edit:  Sorry, I really wasn't reading as much as I should have been.  Your idea for a "coordinate translator" is actually quite cool for this part.  I guess it could be a learning experience for using operator overloading in their projects.
« Last Edit: February 04, 2009, 07:07:35 pm by Andir »
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."
Pages: 1 ... 16 17 [18] 19 20 ... 72