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.


Topics - bitano

Pages: [1]
1
Graphics / Help! Regarding view and world drawing
« on: March 08, 2016, 10:52:00 am »
Hi,

I'm not experienced at all, but i did write a couple of games. I just started with a new one now, but since i want to do this right from the get-go i wanted to double check if the way i go about drawing the world map is in fact the right way to go (or rather - my best option)

Assuming an RPG like game with a tilebased map (standard stuff i suppose).

1. i'd load my map into a 2-dimensional vector (for x, y coords)
2. Each map location has a vector of tiles (so i can layer tiles: i.e: water -> bridge -> signpost
3. At least 25 frames per second i call the draw function
4. The draw function loops through the map vector and compares x,y coordinates with view x,y coords
5. Everything that's within the view is redrawn, keeping tile order in mind per map position

Does this make sense? Or is this highly ineffective compared to an alternative (like drawing the entire tile map only once and then update those tiles requiring change).

kind regards,
Bitano

2
General / InGame scrollable window
« on: April 07, 2015, 12:14:56 am »
Hi guys,

I want to have a scrollable window in my game (for instance to display an inventory).

I'd setup my own InvWindow class which will be part of my Gui class. For the scrollable part of the window i'm assuming i'd best use a separate sf::view to display the items in.

Is this assumption correct or is this the wrong way to go about?

3
General / RenderWindow bounds?!
« on: April 03, 2015, 03:34:24 pm »
Hi there!

Not too long ago i made a game which progressed pretty well, but for some reason crashed after approximately 30 minutes (sometimes 40). It seemed like one of my functions / pointers was leaking somewhere but i couldn't find any cause. As far as i could tell, i made sure to clear up any unused pointers.

I started considering that the leak was caused by one of the SFML functions i might have misinterpreted...I tried to troubleshoot some but in the end let it rest...

-----

Now i'm starting on a new game and this still bugs (pun...lol) me. What i'm thinking at the moment is that the most used function while the game is running is the one drawing tiles to the RenderWindow.

I realized that i never found out whether i should set the outer bounds of a RenderWindow.

Should i define the outer bounds of the RenderWindow somewhere?
What are the size limits of RenderWindow (considering i'd want to use a huge tilemap) ?
What if a function ended up drawing something outside the boundaries of RenderWindow (for example starting from negative X,Y coords)?

I hope i was clear enough on this and that someone is able / willing to help me.

Thanks!

Pages: [1]
anything