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

Pages: 1 2 3 [4] 5
46
General / Re: Searching a good open source project to learn sfml
« on: July 27, 2016, 01:54:46 pm »
Okay :)

Well I'd suggest a bit of c++ basic game programming first.
To learn a bit about how a game is put together.

My suggestion if you already know c++ is to take the challenges on this YouTube play list:

C++/Game Tutorials: https://www.youtube.com/playlist?list=PLSPw4ASQYyynKPY0I-QFHK0iJTjnvNUys

And if you feel uncertain about some aspects of c++ you can simply watch the whole playlist. There are nothing in the challenges not covered in a previous video :)
It's pure consol, but will give you a lot of background knowledge on games. Each challenge is followed by a full explanation on how to program it if you get stuck.

When you have completed that I'd suggest the same book as laurent. But also Web recourses like this pong clone:
http://gamecodeschool.com/sfml/coding-a-simple-pong-game-with-sfml/

Combined the videos and that Web recourse should give you a great start.
Sfml quickly becomes intuitive when you know the basics of it and game programming :)

Best regards and good luck :)

47
General / Re: Searching a good open source project to learn sfml
« on: July 27, 2016, 01:15:43 pm »
What are your programming knowledge? Do you know how to use c++ I'm general or?

Will help us find better samples if we know :)

48
Thank you to you both,
just downloaded it, will play around with it later. but first, an update.

So a lot happened since last video (but not as much as i wanted there to happen.)

-Added character sprites

-added zombies sprites

-did so the levelData calculates what type of ground we have, based on its surroundings.

-added a "walk trough" type of ground (not featured in video)

-added simple AI (walk left for 3-6 sec, tunr around do same)

-added animations

-added "classes" (the 3 characters has different speed, health, mana , jump power and sprites based on their class (currently sprites are just changing belt color, gray = warrior, red= ranger, blue = mage, simple stuff)

-made animation speed scale to walking speed (still need tuning)

-found out that i cannot for the life of me add textures to a vector, so i had to use an array instead :S

and here is the video:


49
SFML projects / Re: Screenshot Thread
« on: July 26, 2016, 12:57:04 am »
@Mortal, that looks awesome from my point of view, but really sad it slows down, do you know where the power drain is hiding?


and a little screenshot from my own game project- taken a good deal of work to get here...

50
This will be a short update:

Got the Texture handler to work, it now takes care of all terrain rendering, and is ready for character rendering when that comes, it allows for one type of tiles (eg level 1 tiles) to use only 1 sf::sprite and one sf::texture to render each and every tile on screen ยด
things with other dimensions would need to have their own sprite (and texture to make it easy to use) but ot can handle it.
it allows each "item" to inform what it is, what animation it is currently using. and what "frame" it is
eg. all the tiles seen here (dirt with grass, dirt and ladders) are of the Type "lvl1" dirt is animation 1, dirt with grass is animation 0, and ladders are animation 14. all set on frame 1, 2 or 3 without looping.


The sample is here: 

51
General / Re: undefined reference to `sf::CircleShape
« on: July 25, 2016, 09:19:19 am »
Without computing it, I think the error is this line:
  sf::CircleShape shape(50);
Circleshapes constructor takes 2 arguments, radius and points.
Either try this:
  sf::CircleShape shape(50,30);
Where 30 is the number of points making the circle
Or do this
  sf::CircleShape shape;
 shape.setRadius(50);

:)

52
Thank you, I'll look into OBS.

About art, yes I do have some.

I've once tried making a webcomic and some forum based games, called meandmypixels I have a lot of art from it I can use... As a start...

Sample:
(click to show/hide)

53
@Mortal
Thank you, i do what i can, when i can. Mostly i don't work much on code, but that day i had a lot of time, so a lot was done :)

ps. does anyone have a good suggestion for a screen capture program, the one i use lag even at 8% cpu usage (3% for the game, 3% for the cam program 2% for mics others), so not wort much :S (frame rate set between 30 and 60, all lag :S

Next update is here:

1: I've added ladders to the terrain, as i figured their use is heavily tied to my terrain hitTest.
2: Fixed the fall down bug, so items no longer gets embedded into the ground or the walls.
3: added a "head" hitTest, so that you cannot jump up trough the ceiling.
4: added a "auto center" function to ladder
5: again removed a lot of double code
6: added a "focus rectangle" to the character image area on the left, showing what character is active
7: added individual mana and hp to each character (randomized for now)

I think that is is.. next up, textures :D



54
Aaand last update of the day..

phew.. I've got a lot of things done.
I cleaned up a lot of code (broke it into functions, deleted unneeded double code, rearranged stuff) but i still need some cleaning of all those hard coded values...

please note that the game is not this laggy, but the cam recorder and other stuff is killing my laptop cpu...

I've added colored blocks to show the "randomization" of the ground tiles
I've added Agents that can interact with the ground
added spatial partitioning so that agents only check the closest ground tiles for collision
added jump ability and move
added the ability to shift between 3 different Agents (This is really important for the game-play)

now, a lot of cleaning up to do.. and i have to figure out why my hit test misses the ground at specific places... maybe i need to convert from float to int :S hmm...

any how.. here is the latest video:


55
I'm glad to be of help.

I'm pretty new myself, so I'd cant answer anything about the scaling of renderwindows- other than toggle fullscreen.

that said, if your screen is bigger than the render window, there is no need to render the stuff outside of it.

say your view is 600 by 400 pixels, with a center of 500 by 100 (render window coordinates)
then before rendering an object, make a test:
if(_x > view.getPosition().x - 300
&& _x <  view.getPosition().x + 200
&& _y > view.getPosition().y - 300
&& _y <  view.getPosition().y + 200) {
then render }

else don't!

this will save a lot of render power...

(300 and 200 should maybe be a bit bigger so things just of the edge is still rendered, also this size should be dynamic so it fits other views (300 should be view.getSize().x/2 and 200 should be the dame for .y instead :) )

do i make sense or do i ramble?

56
-Snip- 1:
3D array? You can store these sorts of levels in a 1D array

-Snip- 2:
As for that third dimension, you can use a single integer value to represent if something exists and which type if it does by using a single value (maybe zero?)
1: yes, i know, and do.. that was what i meant by (flat) 3d array. not sure what else to call it? my arrow looks like so:
Quote
   _xSize = _levelImg.getSize().x;
   _ySize = _levelImg.getSize().y;
   int size = _xSize * _ySize * _depth;
   _tiles = new int[size];
   for (int i = 0; i < _ySize; i++) {
      for (int k = 0; k < _xSize; k++) {
         int Tile = 0;
         if (_levelImg.getPixel(k, i) == sf::Color(0, 0, 0)) Tile = 1;
         
         //Tile can later be 2,3... for sloops, edges... and so one
         _tiles[(k * _depth) + (i * _xSize * 2) + 0] = Tile;
         //the tile set i've drawn have 3 versions of each tile, so determining a random number to make it more seemless
         _tiles[(k * _depth) + (i * _xSize * 2) + 1] = rand() % 3;
      }
   }

2: yes, i could use 0 = nothing, 1,2,3 = ground, 4,5,6 = slope left and so on, I'll consider it :)

*Thanks for all the interest and suggestions, that is awesome and motivating :) :)

*added a video to my previous update, that explains a bit of it :)

57
-Snip- 1:
Rendering many rectangles to display a level of tiles can be highly ineffecient.
-Snip- 2:
You will almost certainly benefit from using a vertex array (or equivalent)
-Snip- 3:
Are you still drawing multiple rectangle shapes?
1: indeed, this is only the solution until Texture and sprites are added later, it is simply because it is faster to set up :)

2: true, currently i use a grid system based on the image (more in 3)

3: yes, or that is, i use 1 rect that are moved to the needed position and then drawn. I use a (flat) 3d int array [width][hight][2]
where 2 is set as 1 or 0 in the first space to indicate if anything is there, and the second is used to determine what type.

I know this is overkill, but it is set up to later support multiple different tiles of each type (so that all grass is not the same, but with some variation to it :)

I also intent to implement it so that the level handler will not render any tiles outside the level :)
//Edit: done - in the spoiler is a sample of what i mean...
(click to show/hide)

but thanks for the link, ill give it a look :)

58
So, current progress since last video:

Added a basic GUI.
Added a life/mana counter that dynamicaly updates (but no real data in it for now) to the gui.
Created a levelData class to handle level loading, collision testing and rendering.
Set bounds for the view and GUI so that if the player travels to the top/bottom/left/right we wont look outside the world.

for now a lot of values are hard coded and needs to be more dynamic. Level data still needs to be encapsulated in a level handler so as to also handle other things than terrain.

here is the video of it:
(notes awesome GUI ;) )





59
Not a bad idea, I added a muck-up and a style description, sadly there is no story right now, as for me its more the challenge of actually making it...

60
not 100% sure but what you mean, but I've done what I think you say...

Pages: 1 2 3 [4] 5
anything