shmups.system11.org

Shmups Forum
 
* FAQ    * Search
 * Register  * Login 
It is currently Sat Jul 31, 2021 7:50 am View unanswered posts
View active topics



Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: new game for fun
PostPosted: Thu Jul 01, 2021 12:35 am 


User avatar

Joined: 16 Feb 2016
Posts: 683
Location: Portugal
heli wrote:
I have chosen not to write any data then people get no administrator windows-10 warning to make changes to your system.
So no highscore saving in this game, maybe more people will play.


You shouldn't be saving config/hiscores on the same folder as the game; if the game is stored in a priviliged folder (such as Program Files) and the user doesn't have administrator right, the game won't be able to create/modify the file(s).
Ever since Windows Vista, at least, application data is supposed to go into the user's documents, saved games or appdata folders.


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Thu Jul 01, 2021 1:09 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
Thank you very much.
If i understand correct :
If i place the save file in user's documents, saved games or appdata folders,
then there will be no administrator warning for changes to your system ?

Ok, now i have to find out where i can find the saved games folder.


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Thu Jul 01, 2021 5:59 pm 


User avatar

Joined: 16 Feb 2016
Posts: 683
Location: Portugal
Technically you need only create/write the files to a non-administrator folder/path and it will work; the saved games/documents/appdata are the recommended places, though. The user might not be too happy if you save the files in random places. :)

To get the path to one of these folders, you can use the SHGetKnownFolderPath function. It only works on Vista and above, so if you are also targeting XP you can use the deprecated function SHGetFolderPath.

The list of folders you can query for SHGetKnownFolderPath is here (and for SHGetFolderPath here).

For example, the following:

Code:
SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &path);


will return the current user's local appdata folder (eg. "c:\users\username\appdata\local") on the pointer "path". You have to call CoTaskMemFree to free the string when you're done with it (the function allocates the string for you). Also, it is a wide string in UTF-16 format.

After that, you can just create a folder for your game data in there and create/write the save files.
Take a look at the links above, as they properly describe what you can do with the function(s).

Alternatively, for some of the special folders, you can also get their path from the environment, using the GetEnvironmentVariable function (I don't know if Windows has libc's getenv() function). For example, the same local appdata directory is in the environment variable %LOCALAPPDATA%.

If you'd like to provide an option for a portable installation (ie. save files in the same folder as the game), a common way to do it is to check for the existence of a specific file (eg. one named "portable.txt") in the game folder, and if it exists then it is a portable installation so the config/save files come from the same folder. Of course, now you still have a problem -- the possibility that the user puts the game in a privileged folder and runs it as non-admin -- but that is the user's problem at this point and you could just quit with an error message.
Another way would be to pass a command line argument to enforce reading/writing the save files from the game folder.

The downside of providing multiple save locations is that you have to think about the possibility that multiple save files exist and which should take precedence.

The functions above are from win32's C API. I don't know which language you're using, but there should be comparable bindings available.

Forgot to add: the save games folder token for the SHGetKnownFolderPath function is FOLDERID_SavedGames. The folder itself is "c:\users\username\saved games" and was introduced in Vista.


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Fri Jul 02, 2021 1:31 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
Thank you very much, great information, and double thanks i am targetting XP, building in XP, with directX 9
It all works perfect in win10 as long as you wont close the game in fullscreen, then norton comes up with shit.


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Fri Jul 02, 2021 1:46 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
The language i use is C++

If someone please like to test for crashes :
https://www.mediafire.com/file/4lanpkob ... e.zip/file
Here it is.

It is not in the state to make a movie yet.
Sick of programming now.

Let me know what you think, or it crashes.
Important : close all important things before playing.

Pressing control sets difficulty to 100%
Dont accidently press it.
Input automaticly is configured to the first joystick it finds, if you want keyboard, you have to change in the menu.
The menu is only keyboard, you have to exit the menu.
Ultra wide monitors no tate mode supported so far.
Have support for 4:3 type monitors.
Made for 16:9


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Sat Jul 03, 2021 2:58 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
No one tried yet ?
Comeon, its the "game of this year edition".


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Sat Jul 03, 2021 3:27 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
I guarantee its better then cyberpunk 2077


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Tue Jul 06, 2021 12:33 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
Still no programming, if i get back on it,
i need to combine vertex buffers to save some GPU.


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Sat Jul 10, 2021 2:13 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
I dont feel like working so i added more for fun instead of finishing the first boss i added a second boss.

Image

Image


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Wed Jul 14, 2021 1:29 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
Still working on the second boss

Image

In this attack pattern the arms should be destroyed and wont show.
Need to work on the first pattern with arms.


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Mon Jul 19, 2021 2:33 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
With arms looks better

Image

I dont know how to move them, i have to find out.
It might take a while.

Once i have it i implement it in the other boss also.


Top
 Offline Profile  
 
 Post subject: Re: new game for fun
PostPosted: Tue Jul 20, 2021 3:53 pm 


User avatar

Joined: 13 Sep 2019
Posts: 355
I made it so you can push the arms away with shooting.
Reminds me of earth defence force 4.1, where you push the big robots so they shoot the wrong direction.
Nice idea, only to random, i removed it, shooting the arms dont messes with the aim, just pushing the arms away.
Still have to think what to do with it, and add collision so it wont go inside itself.
This is way to cool, i keep playing, cool games are bad for production.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Space Pilot 3K template by Jakob Persson
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group