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

Pages: [1] 2
1
Hello guys  :)

Still I'm working on my 3D OpenGL framework, this week I'm gonna focus on landscape;

There are many ways to make 3D terrains. The method that drew my attention most is GPU Geometry Clipmaps. It was introduced in GPU Gems 2: chapter 2, for nvidia. Here a link: https://developer.nvidia.com/gpugems/gpugems2/part-i-geometric-complexity/chapter-2-terrain-rendering-using-gpu-based-geometry .

I have implemented base blocks of their algorithm. It works fine for now, but still there is more to achieve the final result as shown in that chapter. For example, the height-map and normal-map ... etc.

Here the demo for the initial implementation:
https://www.youtube.com/watch?v=KmRS-wCcUvc

2
SFML projects / practice exercises on 3D Physics - SAT algorithm
« on: March 16, 2020, 08:16:55 pm »
This is going to be a bit longer thread dedicated to SAT algorithm and its MTV and SH clipping[for impulse response].


here a simple demo to test the projection of the quad/box onto an arbitrary axis.

every single time i thought that i grasp the dot-product math-vector-entity i end up being was actually fooling myself. I have had to study this elusive entity in depth for once and for good. and here the introduction demo of incoming demos regarding the SAT algorithm.


https://www.youtube.com/watch?v=iM6GNmf7v74



3
SFML projects / Titanion Clone
« on: February 22, 2020, 09:41:29 pm »
Remake of an old game called Titanion, it's a strike down super high-velocity swooping insects game-like somehow similar to the famous Space Invaders. i have been working on this game for sometime, it is part of my 3D OpenGL FrameWork Demos,

i added colours, text and sounds, no textures involved in this game ;D, this is one of many reasons, why i chose to spend sometime to re-create it from scratch.

here game-play demo:
https://www.youtube.com/watch?v=ix4UlztoR-0

4
SFML projects / Intel 8080 Emulator-Space Invaders
« on: January 03, 2020, 06:42:50 pm »
i have managed to make simple a `Intel 8080` 8-bit microprocessor emulator for Space Invaders. however, there is good news and bad news.

the good news is, the sound is working fine with emulator unlike my previous Space Invaders clone https://en.sfml-dev.org/forums/index.php?topic=26821.0
which is still can't get it to working correctly.

the bad news emulator has a bug for some reasons the Space Invaders game crushed when the startup game demo run longer. honestly i don't know what actually cause it, is it a multi-threading issues or memory-corruption, i have no idea.

the cpu runs fine i have tested it with COM test-files.

EDIT: bug is fixed, now the emulator's working fine.

here a Demo of Space Invaders game:

https://www.youtube.com/watch?v=-yKfFlOnxEM

5
SFML projects / Space Invaders Clone
« on: December 26, 2019, 12:57:22 pm »
hello everybody

i just made simple Space Invaders clone that's mimic the original game as possible as i could. it uses the original ROM data of-course to achieve same game experience as playing the original except for cpu cycle time which's not effect the game-play itself but it effects the sound. the game currently has no sound. i'm working to solve this issue hopefully it does't take much time.

the game is not an emulator as what it seems to look like. it is different code made it with SFML/OpenGL.


Demo:
https://www.youtube.com/watch?v=iPV0q4l5FGw



 

6
SFML projects / Tower Defence
« on: May 11, 2017, 08:59:27 pm »
i was planning to begin with 3D game as my first 3D project, but i have found an old game called Starports when i was looking for assets to make simple tower defence. but unfortunately it doesn't support SFML.

i wrote SFML extension to that engine. since it does exactly what i want to achieve for now.

here game-play video:
http://www.youtube.com/watch?v=hEpNgAeqLuQ

EXE file

7
General / comparing floating points
« on: January 24, 2017, 04:55:45 am »
hello.

first of all, apologies for the question wasn't directly related to SFML, but i was so frustrated about what's the proper way to compare floating points.  if someone had similar problem how can we do it.

i read alot of online papers about this subject. the latest one was about ULP which is used the integer comparison instead of comparing the float/double data. i've implemented this already but it seems not working either.
i made minimal example about ULPs method. which is, by the way taken from google units test. and i have changed it a little bit to suite my engine that i'm working on.
the example shows the failure of comparing two matrices for assign operator operator== when i tested the sf::Transform against A A-1 = A-1 A = I.

(click to show/hide)

8
SFML projects / experiment on Terrains
« on: October 30, 2016, 11:50:33 pm »
hello

i was working on terrain lately, i'm trying to cover as much as i can on this topic which it seems, it is massive topic wasn't a best choice to lean basic opengl on this path. but i have made some progresses so far.

here i have made a demo to test opengl 4.4 features by drawing terrain with Tessellation based on nvida demonstration on Tessellation and Program Pipelines. but unfortunately, this technique has huge drawback regarding performance especially for terrain atleast on my Labtop.

the demo shows the terrain colored based on its height and dynamic cloud & lighting effects.i made it with c++/SFML.  i would like to carry on this topic to get a decent knowledge for both opengl in general and terrain in specific

demo:
http://www.youtube.com/watch?v=2iLtqPRua7s

source code: github
 

9
Graphics / sf::Font with GLSL-program
« on: August 03, 2016, 11:02:57 pm »
hello

i'm trying to draw some letters on screen by using sf::Font and opengl-glsl shader, for some reasons the character appear as solid block. after searching for a solution, it turns that i have to enable" blend test" and use blend function but when i used it, the block disappeared as being blend totally with background color.

how to solve this?

here the code i used to draw single letter on screen:
(click to show/hide)

10
General / [solved] drawing in-place
« on: July 05, 2016, 10:17:16 pm »
hello

i'm working on demo for tile-based path-finder's algorithms. fortunately i found awesome tutorial about this subject with live demo, but it was written in javascript as shown here .

author provides C++ source code but it is ASCII console app. i tried to convert it to SFML-app but i had problem with draw the algorithm's processing. after many attempts i have come up with some thing like this .i know, it is awful, and there are many better ways to do it. but i can't wrap my head around it. in javascript, it seems an easy task. like this demo

i would like to know what is the best way to draw these kind of demos with SFML?
is there already open source for it?

thanks in advance

Edit:
SOLVED- i used vertex array. this is alone,  is enough to solve the render issue in my code.


11
SFML projects / Simple Super-Mario game
« on: June 25, 2016, 08:01:52 pm »
hello everyone.

here my first attempt to create simple platform game-alike, it is super mario game. game not yet finished, i just implemented basic components like physic, animation and collision detection. but the levels still need more.

i used Tiled software editor for tile-map  and pugixml lib for map parser.

whole project is meant for educational purpose,  it is suitable for beginner in both sfml/c++.

here main references:
For C++, SFML and animation: "SFML Game Development" book.
For Physics, Graphic Effects and Collision Detection: http://trederia.blogspot.com/

here video demo:(apologises for bad quality of video)

http://www.youtube.com/watch?v=KHOsrcTPdWQ


i would like to know if someone had a chance to compile it, to give me feed back about this game.

thanks in advance

12
General / best way to calculate length of vector
« on: May 24, 2016, 03:30:30 pm »
usually when i wanted to compute the length of vector, i used traditional way as i have learnt from many tutorials by squared root the dot product of given vector. and these were usually defined in free function for each of them. like so,

//calculates dot product of 2 vectors
inline float dot(const sf::Vector2f& lv, const sf::Vector2f& rv)
{
    return lv.x * rv.x + lv.y * rv.y;
}

//Returns length of a given vector
inline float length(const sf::Vector2f& source)
{
    return std::sqrt(dot(source, source));
}

//Returns a given vector with its length normalized to 1
inline sf::Vector2f normalise(sf::Vector2f source)
{
    float length = std::sqrt(dot(source, source));
    if (length != 0) source /= length;
    return source;
}
 

and usage:
auto speed = length(velocity) * dt.asSeconds();
auto amount = normalise(velocity) * speed;
sprite.move(amount );

however, i have found in math.h header file a builtin function hypotf(x,y) that do exactly same thing. later in c++11 defined in cmath by std::hypot(x, y) where x and y is float, which is equivalent to std::fabs(std::complex<float>(x,y)).
typical usage would be some thing like this:

//Returns a given vector with its length normalized to 1
inline sf::Vector2f normalise(sf::Vector2f source)
{
    float length = std::hypot(source.x, source.y);
    if (length != 0) source /= length;
    return source;
}

auto speed = std::hypot(velocity.x, velocity.y) * dt.asSeconds();
auto amount = normalise(velocity) * speed;
sprite.move(amount );
 

as you can see both did same job while the first is most popular and other rarely used in game dev if not used ever.

my question why most of game dev don't use std::hypot and save them from rewriting those free functions of length and the dot every times, is it because of some performance drawbacks due to std::hypot. or they simply don't know about it.

13
General / problem when sf::RenderWindow is noncopyable
« on: May 01, 2016, 09:55:25 pm »
i'm recently working on new game design that reply on boost::any. the idea is simple, storing all update and draw methods for each game entities in appropriate container and call those methods when it is needed. sound simple and it can be done. also i went further and implemented my own any class similar to boost::any. my attempting seems work fine when i tested against primitives type (int, float and so on) even i tested with user-types. all previous tests went smoothly but when time come to test it with sfml i got some issues. for example, sf::Drawable::draw takes two parameters and it can be call through (sfml magic) by instance of any sf::RenderTarget. this doesn't work on my design. i solved it by make game entity non-drawable.

the issue that i can't find any solution for it is when sf::RenderWindow is noncopyable so, whenever, i tried to cast it down from boost::any or from my own any class, i got always bad cast assertion says "sf::RenderWindow& is deleted object". the only cheep solution that i come up with it, is to turn off assert checking, since i don't have access to boost::any, i changed my own any class and comment assert. the test code run fine but i not quite conformable with it.

here my code:
(click to show/hide)

my Questions:
how to solve noncopyable issue?
is my design reliable in game dev?

14
General discussions / Dispatcher with new meta-Function idiom
« on: April 19, 2016, 09:13:31 pm »
hello

i have an opportunity to get a proposal paper that might be included in C++ standard and i would like to share it with you. here a link to pdf file:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4436.pdf.
it is actually an idiom for meta-programming language. since we are mostly interesting in game development, this idiom might helpful for beginners like me to understand and implement it in any way that suits our need in game dev. an easy usage of this idiom would be dispatcher-like structures.

the dispatcher structure has a feature of registration facilities to attach member functions as listeners in easiest way possible. also, it has an ability to call right member function for any handler.

my interesting case to use this idiom in dispatcher-like structure is when i want the score to be updated for any  game's event that may happen.

here is a simple demo.
(click to show/hide)

15
General / scale animation problem
« on: April 05, 2016, 01:37:19 am »
hello

i'm having trouble time with scale animation which i thought it will be most easiest part in my game that i'm working on. but it turned i was wrong about it.

my goal is to achieve smooth and constant scaling animation. i have implemented the "easing" technique to calculate ratio of scale amount that need to step each frame to sprite object. it seems run but i didn't get what i was looking for.  the scaling effect is varying from time to time which is not suppose to happen. some time it goes faster while other goes slower.

also, i have faced problem with float point comparison that i can't compare two float values for equality with if statement, i had to implement "close enough" approach.

i have created minimal example to demonstrate the issue:
(click to show/hide)

my questions
how can i fix this tripping in animation?, is my implementation is correct? and are there other ways to achieve smooth and constant scale animation?

Edit: i fixed it, my bad, it was a bug in both source code. i corrected example here and code in my game both work fine at last but it seems i overly complicated it for just scaling , i'm sure there is an easy way to do it, but i don't know it.

is there a better way to do scale animation?


Pages: [1] 2
anything