Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - flammanj

Pages: [1]
1
Programming / Re: Health and Limbs
« on: July 27, 2012, 09:23:00 PM »
This might sound stupid now, but why not make an advantage out of loosing limbs? Many people adapt to lost limbs by improving their skills on the other limbs.
Maybe a system that needs some time to recover from the shock, and then slowly adapting would be fun (you wouldn't want to give advantages in the very moment when you lose a limb)
Example: HeroX loses his right arm during a fight with some weak little goblin (critical hit). The goblin is slain, the arm is gone. Some time later, the Hero gains skills with one-handed weapons and can evade better. (his left arm and his legs grew stronger)
Example with legs: get some crutches. With extensive use of crutches, you will start to get faster than without, but you cannot evade very well.

I know these are very poor examples, and it doesn't really solve the problem of having the protagonist look like the black knight in Monty Python's Holy grail (no legs no arms...). The point is: once the character has lost one limb, make him sturdier and more cautious towards future attacks.

I do like Dwarf Fortress limb system. Yes, it is very frustrating at some point, and no matter how careful you are (except when completely avoiding combats), you will always at some time lose some part. I have been thinking about a health/damage/limb system since I first wanted to make an own RL. What I will probably be trying out is some kind of prothesis system, where single limbs can be used and exchanged just like armor parts, but of course this does not fit to every theme.

2
Programming / Re: implementing speed in projectiles with libtcod
« on: July 23, 2012, 12:54:45 PM »
@kraflab

I want to make sense of whatever you write, even if you probably are just trolling...
I do not even ask what you mean by the first line. I don't understand what you imply with this and you probably haven't understood what I mean.

Concerning libtcod:
why do you consider it "poop"? Do you prefer writing everything by yourself? Are there better alternatives for "noob" programmers?
I mean, I first wasn't sure about it at first, but it seems to have a solution for most problems I could imagine when it comes to start writing a RL. My first thoughts were: how do you write field of view? how do you start making projectiles etc ? Libtcod was the only solution I found out there, plus I think it is easy to replace libtcod functions with own functions as soon as programming skills grow.
I have no idea what other people think of libtcod and why.
I would always be glad to learn of other alternatives.

3
Programming / implementing speed in projectiles with libtcod
« on: July 23, 2012, 10:40:08 AM »
Hi to all, I am new to this forum and new to the development of RL. Aside from some bits of php, I am a complete newcomer to programming.

I started writing a RL with Python and libtcod, using this totally awesome tutorial on roguebasin:
http://roguebasin.roguelikedevelopment.org/index.php/Complete_Roguelike_Tutorial,_using_python%2Blibtcod

I finished it, understanding quite everything and learning the basics of the language quite fast. Now I stepped out, and wanted to go working towards some own RLs, each becoming more complex.

My first one should be some kind of Sci-Fi-Survival (a bit into the direction of Unreal World). However, I need to implement different things, one after another. To some of you, this may be not too hard, using all the experience you have about general programming. To me, this is a completely new world. I know the theory about game design and similiar stuff, but programming is very new to me.

My first problem is the following:

I spent hours of searching the web and reading existing code to finally write a Projectile system, inside a sandbox I created just for testing such things. I used libtcod's line_step() method.
However, I want to add some kind of speed feature, something that says how fast my projectiles travel.
I understand that I need to multiply some coordinates with a speed factor.
However, my logic fails and I just can't think of where to put this speed factor (maybe I am just too tired).

Could any of you please read through my Projectile class and tell me where to put the speed?
In case you need to know: the game runs in real-time, with 20fps
the prints are just for control, it took me hours to get the drawing of the Projectiles the right way

I am also open for anything else you can see in my code (maybe something that will cause errors at a later point?)

Code: [Select]
class Projectile(Object):

    def __init__(self, x, y, start_x, start_y, end_x, end_y, char, speed, color=libtcod.red):
        self.x = x
        self.y = y
        self.start_x = start_x
        self.start_y = start_y
        self.end_x = end_x
        self.end_y = end_y
        self.speed = speed
        self.color = color
        self.char = char

        libtcod.line_init(start_x, start_y, end_x, end_y)

    def proj_draw(self):
        libtcod.console_set_foreground_color(con, libtcod.red)
        libtcod.console_put_char(con, self.current_x, self.current_y, '*', libtcod.BKGND_NONE)
        projectiles.append(self)
        render_all()
        print('projectile drawn')
        libtcod.console_flush()

    def proj_clear(self, x, y):
        libtcod.console_put_char(con,x,y, ' ', libtcod.BKGND_NONE)

    def proj_step(self):
        #follow line in steps
        self.current_x, self.current_y = libtcod.line_step()
               
        self.proj_draw()
       
        if self.current_x == None or self.current_y == None:
            print('dungalung... hits the floor..')
            return None, None

         #check objects on the way
        if is_blocked(self.current_x, self.current_y):
            print('katsching! the projectile hits')
            return None, None
           

        #out of map - ignore
        #elif map_out(self.current_x, self.current_y):
         #   print('The projectile is gone forever')
          #  return None, None



        return self.current_x, self.current_y

    def proj_shoot(self):
        x, y = self.proj_step()
        ox, oy = self.current_x, self.current_y
        while(not x is None and not y is None):
            print ('duringshot')
            ox, oy = x, y
            x, y = self.proj_step()
            self.proj_clear(ox, oy)
            self.proj_clear(x, y)
        print ('aftershot')
        self.proj_clear(ox, oy)

Pages: [1]