Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 10 Jun 2011
Online Last Active Today, 06:12 PM

Posts I've Made

In Topic: Five Favourite Smiths songs?

27 September 2016 - 01:25 AM

Not to be rude, but what drove you to post this on the "General Programming", in the "Technical Side"?


Wouldn't this be a topic for some lounge/general chat forum?

In Topic: Problem with graphics

26 September 2016 - 01:30 AM

Here's a nice post that lists (and reviews) a few websites that offer graphics for games.


I know you requested free graphics, but, since this is your first game, and you probably won't sell it, you could use sprites ripped from commercial games.

Yes, they are indeed copyrighted by whatever company created them, but for a learning project (or fan games, for that matter), they are very much suitable.


By the way, you can also find free sound clips, music, 3D models, etc, online. Just to a quick search for "free *insert type here*" on Google, and you should find them quite easily.


Anyway, good luck, and welcome to Gamedev.

In Topic: Bullet Collision

21 September 2016 - 11:08 AM

Essentially, it involves throwing a block, and the player teleports wherever it lands.   I have an ObjectId enum which stores my objects for the game. So far, I have a Block, Player, and Bullet (which is the thing you throw in the game) enum. Every new block/bullet that's created is passed its respective enum in its parameter. I use this tag to reference the objects.


Sorry but I'm a bit confused. Do you throw a bullet or a block?

Or do you mean you throw a bullet, that lands on a block, and then the player teleports to that block?


Either way, you need to reduce the number of objects you test for collision.


Physics/Collision libs usually have two phases for testing collisions: the broad phase and the narrow phase.


The broad phase is responsible for finding object pairs that are potentially colliding, and discarding the ones that are not.

This phase usually uses some form of spatial subdivision for the world (quadtrees, octrees, etc) and also tests for potential collisions between objects by using simple bounding volumes (like AABBs or OBBs) instead of the actual object's collision model (which can be much more expensive to test).


The narrow phase is where you check if two objects are actually colliding, using their actual bounding volumes (like you are doing in your code).


Summing it up, the broad phase very quickly and roughly discards non colliding object pairs, and the narrow phase performs the actual test to see if two objects are colliding.


This is much better explained in this article, that I came across a while ago.

It is a 3 part article that also contains physics and constraints, so give it a read if you're interested.


Anyway, hope it helps.

In Topic: Opengl scaling using ortho projection not working correctly

16 September 2016 - 08:01 AM

Yes this solves the problem. But makes another problem in some viewport sizes the line is thicker. It seems that there is no real solution to this problem


Yeah, but you can't really help that, if you view such a small graphic zoomed out, stuff like this will happen.

Have you tried mipmaps? You might get a better result with them.


Even if I solve this problem there is another problem. When zooming in or out at some viewport sizes the alignment of objects breaks. some objects may overlap. I tested this situation in gamemaker 8 and it has the alignment problem.



This, I can't really help, except you could enforce sizes for the viewport zooming, instead of allowing arbitrary zooming amounts.

What I mean is, allow zooming, but in 50% increments (or something along those lines), so that you can ensure it doesn't break the alignment.


Obviously, depending on what you're trying to do, this may not be possible (or wanted), but it's a thought.


Anyway, good luck.

In Topic: Opengl scaling using ortho projection not working correctly

15 September 2016 - 05:41 PM

The color change may happen due to the linear filtering, because by using linear filtering, you're averaging between the 4 closest texels, and, since most of the texture is blueish, the resulting color will also be blueish.


The odd line position thing, may also be somehow related to this (though I can't properly explain it).


Have you tried setting the minification filtering to nearest instead of linear, to see if the results improve? You could keep the magnification filter linear, so that, if you zoom in, the result will be linearly filtered.


Anyway, I'm not sure this is the case, but I hope it helps.