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

Pages: [1] 2 3 4
1
Graphics / Re: How protect the game's image files?
« on: November 19, 2016, 12:43:54 pm »
Just wondering, how do you store the encryption key? I've recently implemented something similar - that is, loading encrypted archives into memory upon initialization and decrypting them with AES (I'm not using the .ZIP's built-in encryption though). I'm currently calculating the key at runtime as I didn't want to store it as plaintext within the binary - but perhaps there's a way to obfuscate the process even further?

I think that people who knows how to see password written in the binary will achieve the key with ofuscation too.

I don't know if it's possible to only let the game to open the encrypted files avoiding the user access from the folder. That could help but i don't know how to do it.

2
Graphics / Re: How protect the game's image files?
« on: November 09, 2016, 11:27:03 pm »
There is no error compiling.

if(unzOpenCurrentFilePassword(unz_file, password) == UNZ_OK) std::cout << "OPENED" << std::endl;

The unzipping fails because the return of the function it's not UNZ_OK.
I know, but what is it then? Check what values can return unzOpenCurrentFilePassword and what it actually returns.

Solved.

The problem was in the encrytion method. In winzip you have to choose "inherit Zip 2.0". 

There is only one valid return value wich is UNZ_OK. This is from the library.

extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
                                                  const char* password));
/*
  Open for reading data the current file in the zipfile.
  password is a crypting password
  If there is no error, the return value is UNZ_OK.
*/

 

3
Graphics / Re: How protect the game's image files?
« on: November 09, 2016, 10:34:50 pm »
There is no error compiling.

if(unzOpenCurrentFilePassword(unz_file, password) == UNZ_OK) std::cout << "OPENED" << std::endl;

The unzipping fails because the return of the function it's not UNZ_OK.


4
Graphics / Re: How protect the game's image files?
« on: November 09, 2016, 07:13:54 pm »
I'm triying the simple solution of compressing the data adding a password. I'm using minizip library provided in the zlib homepage.

Now i can read info from zips but the problem comes when adding a password. There aren't tutorials on the internet. Minizip library is well documented but there aren''t examples. They provide unzOpenCurrentFilePassword function that is the same as unzOpenCurrentFile but adding a second parameter for password. I don't understand why the password function fails.

This code works.


            unzFile unz_file = unzOpen("tilesets/tileset_01.zip");
                if (unz_file == nullptr) std::cout << "Unz_file is nullptr" << std::endl;
                unz_file_info info;
                unzGetCurrentFileInfo(unz_file, &info, NULL, 0, NULL, 0, NULL, 0);
       
                char *file = (char*)malloc(info.uncompressed_size);
                //std::string password = "lapislazuli";
                //if(unzOpenCurrentFilePassword(unz_file, password.c_str()) == UNZ_OK) std::cout << "OPENED" << std::endl;
                if (unzOpenCurrentFile(unz_file) == UNZ_OK) std::cout << "OPENED" << std::endl;
                unzReadCurrentFile(unz_file, file, info.uncompressed_size);

                sf::Image image;
                image.loadFromMemory(&file[0], info.uncompressed_size);
                tileset_texture.loadFromImage(image);
               
                free(file);


Anyone knows how to do it with this library or with a differentr one?

5
Graphics / Re: How protect the game's image files?
« on: November 08, 2016, 12:14:56 am »
Maibe there exists a way to hide resources putting everything into one executable leaving only the data that will be modified like save game data.

6
Graphics / Re: [SOLVED] How to detect in sfml that opengl driver fails?
« on: August 30, 2016, 12:04:26 am »
The computer that had problems was using opengl 1.1 versión. The solution is to check the correct version and show to the player the recommendation to update the opengl driver.
Or more like install a dedicated driver in the first place. :P

Yes exactly. That should be the message.

But in that concrete case Intel G41 chipset with graphic card integrated doesn't have drivers for Windows 8.1. Maibe the only solution is to install a Windows version that have graphic drivers support.

7
Graphics / Re: [SOLVED] How to detect in sfml that opengl driver fails?
« on: August 27, 2016, 04:07:13 pm »
The computer that had problems was using opengl 1.1 versión. The solution is to check the correct version and show to the player the recommendation to update the opengl driver.

bool GameApp::checkOpenGL()
{
        sf::ContextSettings settings = window.getSettings();
        float openGL_version = std::stod(std::to_string(settings.majorVersion) + "." + std::to_string(settings.minorVersion));
        return openGL_version >= 1.2f;
}
 

8
Window / Re: Black screen in fullscreen mode when updating windows 10
« on: August 17, 2016, 06:36:30 pm »
In window.pollevent(event) where i check keys i was using a "if" instead of "while" loop. Problem solved but strange that happened when updating Windows.


9
General / Re: Strange Movement with Fixed Timestep
« on: August 17, 2016, 12:57:08 pm »
Put updateStates(dt) after the while loop not in it and before the rendering and activate vsync and look what happens.

10
Window / Re: Black screen in fullscreen mode when updating windows 10
« on: August 16, 2016, 06:08:23 pm »
what version of SFML ?

what video card and drivers ?

The sfml version is 2.3.2 and video card us NVidia Geforce 920M

Still having the problem but only when changing from windowed to fullscreen, if i create the window in fullscreen mode on the application first execution it works.

11
General / Re: Strange Movement with Fixed Timestep
« on: August 16, 2016, 05:55:01 pm »
The problem was in the transitions between scenerios, i move the camera like in megaman and then run a lua script to load enemies that causes  fps go from 60 to 55 generating the graphics corruption with the time.
Is this file access?
Does this camera move still stutter without this loading?

The problem has been solved and has nothing to do with scripts, just was a collateral effect. The problem was that i was updating everything in this loop

while (timestep.isTimeToIntegrate())
{

..
update(dt);
 ..

}

Now i'm updating with your library in my MovementComponent class and in the Camera class and i quit this checking in the gameloop. I need to read more about time controlling and understand better your library.


12
General / Re: Strange Movement with Fixed Timestep
« on: August 15, 2016, 01:43:08 am »
If it stuttering when moving the view (your camera is a view?), it could be the way you update based on the current view that is slowing things down. Are you drawing everything offscreen at all times as well, or are you only drawing things that are visible by testing to see if they're in the view?

Non-integer values can be fine. They can cause troubles with some rasterisation - with textures in particular. You can use integer values to help avoid these troubles, which include gaps in tilemaps. However, using integer values for positions when in motion mean that the values aren't exactly correct and therefore can cause a slight stuttering effect. In this case, it's a tradeoff: smooth motion or perfect rasterisation. There are, of course, other ways to avoid rasterisation troubles. They depend on the troubles you are facing.

Is this a tile map over which you are moving the camera?

The vertex array was 100x100 tiles with 4 layers  :P

I made it 40x10 and had the same issue but with lower cpu.

The problem was in the transitions between scenerios, i move the camera like in megaman and then run a lua script to load enemies that causes  fps go from 60 to 55 generating the graphics corruption with the time. Having mozilla opened causes a little stuttering every minute but not causes the massive corruption of graphics like the script.

Tomorrow i will play more time and see if the problem is reproduced or not. I have to work in an algorithm to resize the vertex array every second to allow big levels at low cpu and less memory usage.

13
General / Re: Strange Movement with Fixed Timestep
« on: August 14, 2016, 09:47:56 pm »
If the positions are interpolated to make smooth movements that means that i must use non integer values for moving views. ¿That will cause problems? ¿What i should do?

I was using this function to store the decimals and only setting positions with integer values.

void Movement::moveNowInteger(sf::Vector2f n)
{
        if(n.x > 0.f) process_move_right += n.x;
        if (n.x < 0.f) process_move_left += (-n.x);
        if (n.y > 0.f) process_move_down += n.y;
        if (n.y < 0.f) process_move_up += (-n.y);
       
        if (process_move_right > 1.f)
        {
                moveNow(sf::Vector2f(std::floor(process_move_right), 0.f));
                process_move_right -= std::floor(process_move_right);
        }
        else if (process_move_left > 1.f)
        {
                moveNow(sf::Vector2f(-std::floor(process_move_left), 0.f));
                process_move_left -= std::floor(process_move_left);
        }

        if (process_move_down > 1.f)
        {
                moveNow(sf::Vector2f(0.f, std::floor(process_move_down)));
                process_move_down -= std::floor(process_move_down) ;

        }
        if (process_move_up > 1.f)
        {
                moveNow(sf::Vector2f(0.f, -std::floor(process_move_up)));
                process_move_up -= std::floor(process_move_up);
        }
}

Currently i'm integrating your kairos library to my game and i can move the view with a smooth movement and without flickering. The problem comes when i keep the program 1 minute or more moving the camera, it begins stuttering exaggeratedly.

14
I updated windows 10 and now i cannot see my game in fullscreen mode. If i keep pressed the windows button + M  on the keyboard  I see the game in fullscreen mode without the black screen.

15
General / Re: Strange Movement with Fixed Timestep
« on: August 14, 2016, 11:50:17 am »
I'm having the same problem but only in the window mode and no so often, it's a stuttering that happens suddendly each 2 seconds when moving the map at high velocity.

I'm using kairos and doing interpolation at 60 fps. What i look strange is that fps is 59.5 and not 60 in the computer that causes the problem.

PD: It seems a problem of cpu or memory usage because if i restart laptop and pc it doesn't happen the stuttering. It comes with time.

Pages: [1] 2 3 4
anything