Welcome, Guest. Please login or register. Did you miss your activation email?

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 - lezebulon

Pages: [1] 2 3
1
SFML projects / Re: SFML Python console
« on: December 27, 2015, 01:38:32 pm »
indeed I just noticed that my python shell works as you described when I try to enter a function definition for instance.
However I have no idea how it's done, from the C-Api point of view. The command line that is sent to python C Api uses the flag Py_single_input , so that it evaluates in shell-mode and prints the last result statement in some case (like when I type 'a' and not when I type 'a=2'). I have no idea how to tell it that in some cases it should wait for an empty line before processing (because I don't want to have to type an extra empty line for all comands)

2
SFML projects / SFML Python console
« on: December 26, 2015, 06:42:19 pm »


Hi !
So I was thinking how to make to tools to help game making and debuging.

This project is based on the Lua console from FRex (http://en.sfml-dev.org/forums/index.php?topic=15962), and its purpose is to be a python shell within SFML that will also automatically be linked with game objects for debugging / inspection etc.

How does it work?
- user creates a swig wrapper file telling swig what objects are to be exported from C++ to python (for instance, "Player" class, etc)
- a specific project is dedicated to building the python module (.pyd file) generated by swig, which exposes the game objects
- within the actual SFML game, I use the Python C Api to do several things. A python shell is loaded and is bound to the SFML Console for rendering and input, then the previous pyd module is imported so the shell has the knowledge of some C++ classes within Python. From the SFML app, the user can specify which instances of game objects can be in scope within the python shell. For insance in the picture I put the instance named "pl" of a C++ "Player" class, into the global python objects, so the C++ object can be directly manipulated through the python console

limitations
due to the input format of the console it's not really possible to input multi-line strings and tabulations, which is pretty bad since the scripting language is python. So it's not really possible to input new functions in the shell


I'll post the source code later if anyone is interested



3
General / Re: SFML ingame console?
« on: December 24, 2015, 01:48:29 pm »
Very nice ! I'll have a try with this later after christmas :)

BTW I looked at the source code, but is it really necessary to draw everything glyph by glyph, making a new quad for each character? I honestly don't know how it is possible to do it differently, but I find it strange that it requires to go that much into "low-level" details to do a console...

4
General / SFML ingame console?
« on: December 24, 2015, 12:52:49 am »
Hi!
is there a code snippet somewhere or a full source code on how to make a in-game "console" window in sfml?
basically :
- a text area is shown that will display what text is entered
- when enter is pressed, the text that was entered goes into a variable and an event is fired
- show output may or may not be displayed in the console window
Basically this :


Is there a way to do this easily?

5
SFML projects / Re:creation - a top down action adventure about undeads
« on: November 28, 2015, 02:06:34 pm »
Hi!
from experience, when you do shadows this way you really cannot skew them that much without it looking really bad
the reason is simply that the shadow should be the projection of the outline of the 3D object, and with a 2D sprite you only know the outline of the object when you see it from the camera point of view.

This can work fine in any direction as long as the original 3D object has a circulat symmetry (like a pine tree), where the outline from all angles is the same. But basically if you want the shadow to be drawn on the upper-right of the object, the shape of the shadow should be the outline of the object seen from the lower-left... there is no way to tell what it should be just based on the sprite since it's just a view of the object from the top

6
SFML projects / Re:creation - a top down action rpg about undeads
« on: September 08, 2015, 01:05:55 am »
Implementing a double dispatch system in O(1) is relatively easy: you create a 2D table of function objects/pointers, where each row and column is indexed by the entity type.
Yup, but how is the concept of "entity type" even defined ? Usually the "type" is defined by the class hierarchy, but since there's no class hierarchy in an ECS, for me it's either:
- an entity type is an instance of an entity, which means a full vtable for each instance (still doesn't explain according to what criteria it should be filled)
- an entity type is a given combination of components, which means that they are 2^N possible entity types for a total of N components. Which means that we have to careful think about which combination of component should be dispatched to which virtual function.

I mean, it seems to me that there's always a point where, if we want to keep everything flexible, we are facing a combinatorial explosion simply because an entity could be any combination of components

7
SFML projects / Re:creation - a top down action rpg about undeads
« on: September 07, 2015, 09:20:12 pm »
This is all done by scripting. When two entities collide, a Lua function for each entity is called which does all the stuff.

Sorry I'm really not being clear :)  what I didn't get was, how do you determine which Lua function to call on the entity? At this point, you only know that 2 entities collided, and each entity is defined only by the list of its component (if I understood). So based on this, how do you figure out which Lua response to call ? I can think of several ways of doing it, but none that would be flexible enough and be in O(1)

Sorry I'm asking so much btw, I've always seens tons of ECS thrown around , but on every implementation it seems they never manage to make the whole thing work in constant time (with respect to the number of total component, system, etc). Whereas for me the point of ECS is that it's really easy to scale

8
SFML projects / Re:creation - a top down action rpg about undeads
« on: September 06, 2015, 09:58:50 pm »
Events. Collisions don't happen frequently, so this is not a big perfomance issue.
Sorry I don't get it,
I'm assuming that for collision you run the collision update method on something like std::vector<ColisionCpt> , right ?
In that case, how do you know which entities the event should refer to ? Or does your collision component hold a pointer to an entity ?
And when firing the event, by what system do you know that entity A should respond to the collision by dying (for instance), and that entity B should respond by moving back? Is that because the collision response is a virtual method?

9
SFML projects / Re:creation - a top down action rpg about undeads
« on: September 05, 2015, 01:44:01 am »
I've been looking at game designs things for year and I always see people praising ECS everywhere, except that I've never seen an ECS actually working well for a medium-sized game or more. Like, I get that an entity is any aggregation of components but I don't get how the logic will be simplified, because the logic would have to be working on the whole entity itself, and not each component independently anyway....

Anyway Elias, you don't need *absolute* contiguous memory for the whole iteration of all the components of a single type. You could store things in like an std::vector < std::array < ComponentType, 128 > > , so that 128 items will be contigous. From an index i, you can easily work out that the object should be placed at index (i/128, i %128), which will end up being calculated really fast. I admit this requires re-coding a whole new data structure but with the requirements you are saying, there is no way around that.

10
Graphics / Re: sf::VertexArray using incorrect texture coordinates?
« on: January 11, 2015, 10:09:33 pm »
thanks!
however is there any info about what the specific rasterisation issue is ?
If possible I'd like to get around this issue by only allowing specific zoom values, however I don't fully understand the issue so I don't know what zoom values allowing specifically.
For instance, I think there are tons of zoom factors between 1x and 2x that would not cause this rasterization problem, but I have no idea how to find them.

11
Graphics / Re: sf::VertexArray using incorrect texture coordinates?
« on: January 11, 2015, 09:26:50 pm »
Even with the camera with a center and size that are integer values, I still have the same issue.
Also it seems that it is only happening on the left / right borders, never on the up / right borders... so I really don't get it

12
Graphics / sf::VertexArray using incorrect texture coordinates?
« on: January 10, 2015, 02:57:45 pm »
Hi
I'm using a sf::VertexArray to display a tilemap : my array is composed of groups of 4 vertices making a square and each square is set to specific texture subrectangle.
 This works fine and give the intended result using a tileset as a sf::Texture (with smoothing off). However when I un-zoom my view and move it around, it seems that sometimes the subrectangle used for the texture goes 1 pixel off, which has the effect to draw 1 pixel from another tile in the tileset. I attached the picture for visual results of what I get when I move around. Again, this works fine when my view is 1:1 or when I zoom *in* .
Does anyone have an idea about this ? I'm using SFML 2.2 (from the github repo) and I kind of remember seeing this issue being mentionned here but I was unable to find it.

thanks!

13
SFML projects / Re: Unamed 2D rpg game
« on: January 02, 2015, 07:15:29 pm »
Hi!
thanks for the feedback ! I forgot to mention that the WASD keys (or ZQSD keys) are also intended to be bound to mouvement key but that's just supposed to allow easier debug.
thanks for your other point about the projectiles, I didn't realize that

14
SFML projects / Unamed 2D rpg game
« on: January 02, 2015, 12:21:08 am »

Hi,

I've been working on this for the past couple weeks. So far this is a basic "engine" that is using a tileset to display the world as a 2D grid.
Commands :
arrow keys
F - flashlight
X/C/V - change zoom
E - fire projectiles (you can keep the button down)

file in ressources/ folder contains the config files as plain text, you should be able to edit things if you want, the entry point is Game.txt

I'm interested in any bugs you find, and also if you manage to keep a decent framerate even with dezoom.

download link : http://www.fast-files.com/getfile.aspx?file=83962

Also, I'm looking for a name for this "engine", if anyone has an idea :)

15
Graphics / Re: Animated tiles without looping ?
« on: December 25, 2014, 03:51:01 pm »
Hi
no I'm already doing the second solution in the code you posted.
Basically I'm asking if there's a way for the code that updates the animated tiles to not call a function on each instance of sf::Sprite (whether it's hidden away or not). I'm guessing the only way then would be to change the sf::Texture directly but it's going to be even slower and more complex.


Pages: [1] 2 3
anything