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.


Topics - MisterMoxxie

Pages: [1]
1
Design / UI design (WIP)
« on: October 06, 2017, 11:30:38 PM »
Looking for tips and suggestions on my new UI design.. black space would be filled by the play field.

The status bars at the top are as follows - left to right; Health, Stamina, Light (see below*), Magic/Mana, Experience.

The 12 spaces below (4 of which are occupied) are for displaying status effects or conditions that are currently affecting the player. The shown status effects are as follows; Poision, Perception buff, Speed buff, Strength debuff. You would be able to mouse-over each 'icon' for more detail.

The stats listed below are player stats; Strength, Constitution, Intelligence, Perception, Stamina - and combat stats; Damage, Defense, and Speed. Neutral stats are in white, buff stats in green, and debuffed stats in red.

Below that are 3 hotkeys which the player is able to assign for using common items without going into the inventory or related screens. Hotkey 1 is assigned to a "Healing Potion", hotkey 2 is assigned to an "Oil Flask" and hotkey 3 is empty.

On the bottom portion is your 'current target' area. This would show the info you know (or do not know, as indicated by question marks) about the current target (or last target hit).It also features 4 status effect areas for possibly known status effects currently applied to that target.This would clear out and be empty space once that target is killed.

*Light is used in my game instead of a 'hunger' type mechanic. The player carries an oil lamp, which must stay filled. Letting this burn out reduces the FoV to only the tiles North, East, South and West of the player (not even diagonals), making navigation and combat very difficult, if not impossible.

Let me know what you think!

Message log at the top : https://i.imgur.com/1v7Ahl5.png
Message log at the bottom : https://i.imgur.com/GI3dUBx.png

Edit :: A poster on reddit requested a mockup with the message log on the bottom, so I added that link as well. Now I'm not sure which I like more.  ::) :P

2
Programming / Smart AI vs Expensive AI
« on: June 22, 2014, 10:06:19 PM »
Hey, there, Temple goers!

One of my driving motivations in developing a rogue-like has always been doing an interesting AI system, one that could produce results that would surprise the players, as well as myself. I've got some pretty interesting ideas on how I want to set the system up, how I want my creatures to react to certain things, etc. However, I can't get around one major stumbling block.

In the design process for a smarter AI system, one obvious thing comes up. Creatures need to be able to 'see' what is around them, in order to react to what is there and choose what task they're going to focus on. I've been trying to wrap my brain around a way to do this, without just calling a ton of field of view algorithms every time a monster moves or takes a turn.

The only plausible idea I have come up with, so far, would be to allow creatures to see everything that is in the room they are in. Then, when populating the dungeon, each room would contain a list of all objects that are in that room. It seems like it would work pretty well. However, when the creatures are in hallways or otherwise in between rooms, I would still have to do some sort of FoV call.

What are your guys' ideas? By the way, I'm using Libtcod 1.5.1 and Python, but it's a pretty general question, really.
Thanks in advance!
 

3
Programming / Not mapping tiles correctly (Python/Libtcod 1.5.1)
« on: May 28, 2014, 04:11:20 AM »
Hello!

I'm working on mapping my custom 'tile' font for use in Libtcod 1.5.1 with Python. I've set up a rendering test to make sure that I've mapped the font correctly, and that I know the corresponding ID numbers for my 'tiles'. In libtcod, you can not specify seperate tile sizes. Since it's mapped with the font, all the characters have to be the same. However I want 32x32 tiles, and 16x16 font. The obvious workaround, was to just map 4 16x16 tiles for each 32x32, and render them that way.

It's been working well so far, save one strange issue. For some reason, it does not seem to be recognizing all of the 32x32 wall tile, only the bottom-right corner. You can see in my render test, the highlighted area is where I think the wall tiles should be. I actually placed a second 32x32 wall tile right next to the first, to see if it would render that way.

Here's my source, as well as links to my 'font' file, the render test, and the specific documentation for this process in LibTCOD. Thanks for taking the time to help me out!

Mapping the Font
Code: [Select]
#small tiles
libtcod.console_map_ascii_codes_to_font(256, 1, 0, 5)  #map all characters in 1st row
libtcod.console_map_ascii_codes_to_font(257, 3, 0, 6)
libtcod.console_map_ascii_codes_to_font(260, 2, 0, 7)  # ...
libtcod.console_map_ascii_codes_to_font(262, 1, 0, 8)
libtcod.console_map_ascii_codes_to_font(263, 1, 0, 9)  #map all characters in 5th row

#large tiles
libtcod.console_map_ascii_codes_to_font(264, 8, 0, 10)  #map all characters in 6th row
libtcod.console_map_ascii_codes_to_font(272, 8, 0, 11)
libtcod.console_map_ascii_codes_to_font(280, 6, 0, 12)
libtcod.console_map_ascii_codes_to_font(286, 6, 0, 13)
libtcod.console_map_ascii_codes_to_font(292, 4, 0, 14)
libtcod.console_map_ascii_codes_to_font(296, 4, 0, 15)  # ...
libtcod.console_map_ascii_codes_to_font(300, 2, 0, 16)
libtcod.console_map_ascii_codes_to_font(302, 2, 0, 17)
libtcod.console_map_ascii_codes_to_font(304, 2, 0, 18)
libtcod.console_map_ascii_codes_to_font(306, 2, 0, 19)  #map all characters in 15th row

Rendering Test
Code: [Select]
n = 160

for x in range (3, 67, 7):
    for y in xrange(2,46,2):
        libtcod.console_put_char_ex(window, x, y, n, libtcod.white, libtcod.black)
        libtcod.console_print(window, x+1, y, ':' + str(n))
        n = n + 1

Documentation : http://doryen.eptalys.net/data/libtcod/doc/1.5.1/html2/console_set_custom_font.html?py=true
Render Test : http://oi61.tinypic.com/11rgpax.jpg
Font Image : http://oi57.tinypic.com/fnaanr.jpg (Yes, the background is actually transparent. It just got changed when it was uploaded.

4
 Hello!

Ive recently tried setting up python/libtcod on one of my Ubuntu machines. It will run the samples.py file fine, good FPS and all. But for some reason when I set up from the first part of the tutorial, it won't run it at all. No error messages or anything, just nothing happens. I went into properties and checked the 'execute as program' box like I had to do with the samples file, but to no avail. Anyone know why this is?

My project folder looks like this;
- arial10x10.png
- FirstRL.py
- libSDL.so
- libtcod.so
- libtcodpy.py

and FirstRL.py looks like this;


Code: [Select]
import libtcodpy as libtcod
 
#actual size of the window
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
 
LIMIT_FPS = 20  #20 frames-per-second maximum
 
 
libtcod.console_set_custom_font('arial10x10.png', libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD)
 
libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'FirstRL', False)
 
libtcod.sys_set_fps(LIMIT_FPS)
 
Hello!

Ive recently tried setting up python/libtcod on one of my Ubuntu machines. It will run the samples.py file fine, good FPS and all. But for some reason when I set up from the first part of the tutorial, it won't run it at all. No error messages or anything, just nothing happens. I went into properties and checked the 'execute as program' box like I had to do with the samples file, but to no avail. Anyone know why this is?

My project folder looks like this;
- arial10x10.png
- FirstRL.py
- libSDL.so
- libtcod.so
- libtcodpy.py

and FirstRL.py looks like this;

[code]import libtcodpy as libtcod
 
#actual size of the window
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
 
LIMIT_FPS = 20  #20 frames-per-second maximum
 
 
def handle_keys():
    global playerx, playery
 
    #key = libtcod.console_check_for_keypress()  #real-time
    key = libtcod.console_wait_for_keypress(True)  #turn-based
 
    if key.vk == libtcod.KEY_ENTER and key.lalt:
        #Alt+Enter: toggle fullscreen
        libtcod.console_set_fullscreen(not libtcod.console_is_fullscreen())
 
    elif key.vk == libtcod.KEY_ESCAPE:
        return True  #exit game
 
    #movement keys
    if libtcod.console_is_key_pressed(libtcod.KEY_UP):
        playery -= 1
 
    elif libtcod.console_is_key_pressed(libtcod.KEY_DOWN):
        playery += 1
 
    elif libtcod.console_is_key_pressed(libtcod.KEY_LEFT):
        playerx -= 1
 
    elif libtcod.console_is_key_pressed(libtcod.KEY_RIGHT):
        playerx += 1
 
 
#############################################
# Initialization & Main Loop
#############################################
 
libtcod.console_set_custom_font('arial10x10.png', libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD)
libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'python/libtcod tutorial', False)
libtcod.sys_set_fps(LIMIT_FPS)
 
playerx = SCREEN_WIDTH/2
playery = SCREEN_HEIGHT/2
 
while not libtcod.console_is_window_closed():
 
    libtcod.console_set_default_foreground(0, libtcod.white)
    libtcod.console_put_char(0, playerx, playery, '@', libtcod.BKGND_NONE)
 
    libtcod.console_flush()
 
    libtcod.console_put_char(0, playerx, playery, ' ', libtcod.BKGND_NONE)
 
    #handle keys and exit game if needed
    exit = handle_keys()
    if exit:
        break

edit ::

I updated the source, and found some new info. If I run the script from the terminal, I get this error.

Quote
Traceback (most recent call last):
  File "/home/***/Documents/Python/projects/FirstRL/FirstRL.py", line 1, in <module>
    import libtcodpy as libtcod
  File "/home/***/Documents/Python/projects/FirstRL/libtcodpy.py", line 47, in <module>
    _lib = ctypes.cdll['./libtcod.so']
  File "/usr/lib/python2.7/ctypes/__init__.py", line 428, in __getitem__
    return getattr(self, name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 423, in __getattr__
    dll = self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: ./libtcod.so: cannot open shared object file: No such file or directory

..even though libtcod.so is in the same folder.

Another very strange thing. I copied the FirstRL.py file and the font file into the Libtcod-1.5.1 folder, and ran it from the terminal. It produced the same error. However the sample in that same folder runs fine, even if its not launched from the terminal.

5
Programming / Find all 'objects' in an area (python+libtcod)
« on: April 24, 2012, 02:01:23 AM »
Hello! I've been following the 'complete roguelike tutorial using Python and Libtcod' tutorial, and it's been wonderful.

I finished the whole of the tutorial, and have since begun rewriting the AI. I want to create a need-driven AI, but I'm having a bit of trouble. I'm trying to use the FOV kit within libtcod to create a field of view from the creature, and then create a list of all of the objects that creature can see.

Here's what I have so far.

Code: [Select]
class AI_Evaluate
#AI Component - Creature is evaluating it's situation

objects = [] #a list of all the objects the creature can see

#get an FOV for the creature
my_fov = libtcod.map_new(MAP_WIDTH, MAP_HEIGHT)
for y in range(MAP_HEIGHT):
for x in range(MAP_WIDTH):
libtcod.map_set_properties(my_fov, self.x, self.y, not map[x][y].block_sight, not map[x][y].blocked)

for y in range(MAP_HEIGHT):
for x in range(MAP_WIDTH):
#visible = libtcod.map_is_in_fov(my_fov, x, y)
#if visible:
#if there is an object here:
#objects.append(object)

any ideas?

Pages: [1]