Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

fatal error issue - need help diagnosing it

A topic by Polygonal Illusions created Aug 03, 2023 Views: 596 Replies: 10
Viewing posts 1 to 4
(2 edits)

Hi guys, can anyone help with what is causing this fatal error message. I've checked that my textures are named correctly without spaces but i don't think this is a texture naming issue as a believe that is a string filename error (correct me if I'm wrong)

i swear i closed my project last night and everything was fine. I've already spent a lot of time of this and I'd hate to lose my progress, any help would be much appreciated.

Source: System.Drawing

Reason: Parameter is not valid.

Stack trace:    at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)

   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)

   at EasyFPSEditor15.MapPictureLayer..ctor(Int32 cellSize)

   at EasyFPSEditor15.MapWindow.Clear()

   at EasyFPSEditor15.Map.Clear()

   at EasyFPSEditor15.Map.Load(String path)

   at EasyFPSEditor15.Editor.LoadMap(Int32 index)

   at EasyFPSEditor15.MainForm.ListBoxMapsSelectedIndexChanged(Object sender, EventArgs e)

   at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)

   at System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)

   at EasyFPSEditor15.Editor.OpenProject()

   at EasyFPSEditor15.MainForm.OpenProjectToolStripMenuItemClick(Object sender, EventArgs e)

   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)

   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)

   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)

   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)

   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)

   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)

   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)

   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

   at System.Windows.Forms.ToolStrip.WndProc(Message& m)

   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

looks like misnamed file to me.

might not necessarily be a texture though, if you created any new decorations, enemies or pickup sprites last time you had your project open, it could possibly return the same error if its looks for the first frame of animation for that deco or enemy.

go through all your folders, look for non-alphanumeric characters, if you cant find them, back up your .dat files, erase everything in maps.dat, then start with deleting stuff in enemies.dat first. see if it loads, if it doesn't then enemy isnt the problem. proceed with decorations.dat, et al. when you find the one that getting rid of the stuff in it allows the project to load, then you know where your problem is and you can do a throrough check of those images to find the one that is misnamed. get it right, replace dat files with your backed up ones, and you should be ok. the technical term for this process is "deconfuckulating"

(1 edit)

Hi Ragnar, thanks so much for the reply, I always appreciate your efforts to help out the community. 

What is the significance of looking for non-alphanumeric characters? Can files not start with anything that isn't a letter or number? If that is the case I did I quick search this morning and found a texture that started with an underscore. However I changed this in both the textures.dat file and in the texture folder itself and I still got the fatal error message.

The only things I did in my last session was create new textures and create some custom modifiers (like a table/chair etc) but all of these are named in the conventional way without spaces.

I'll have to do a complete "deconfuckulating" diagnosis when I have more time haha. 

I did read on a different forum that this error message:

System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)

 at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)

https://stackoverflow.com/questions/11996335/drawtobitmap-system-argumentexcepti...

Could be caused by to much memory usage(?) Because a bitmap is too large(?) I'm not really to sure but could this be the case?

yah efpse cannot handle anything special characters in your filenames whatsoever

no underscores, no spaces, nothing but a to z and 0 to 9. anything else will crash.

if you get your textures from an asset pack and they have filenames with underscores or other characters efpse doesnt like, there is a free batch renaming program, https://www.advancedrenamer.com/ that i have used that makes it alot easier to import your textures to efpse, and not have to rename every texture individually before import.

I had no idea that you couldn't use underscores! The strange thing about that is that I've been using underscores in pretty much all of my filenames since I started this project a couple of months ago and ive only now had issues with it. 

Thanks for the tip on the program I'll have to use that, rename everything and see if that makes a difference.

don't batch rename your enemy, decoration or weapon sprites tho, efpse needs them to have specific names

Thanks for the tip I'll remember not to touch them. When I'm changing the texture names do I need to do it both in the texture folder and the .dat file?

yes, you need the filename references in textures.dat to match what the actual filenames are

i wasnt suggesting you batch rename all the ones you have already imported, just fix any that have fucked up filenames.

in the future, using batch renamer before importing the textures makes it easier imo. since you already have textures imported for this project, i would just deconfuckulate it

(2 edits)

Hey I just thought I'd give an update on this incase anyone else has this issue as I believe I've got to the bottom of it. So just to be thorough I changed every texture name to exclude any special characters at all, I did this in both the texture folder and the .dat file to make sure they matched. I did the same with the tiles/custom modifiers .dat file just to be sure (these where the only 2 things that I had added before the error)

However I was still getting the error so I decided to start deleting one texture at a time and load the game and after about 4 texture the map loaded fine. I re-done this with random textures just incase it was one specific texture that was giving me issues but no matter the texture after about 4 got deleted the map loaded so I believe that I actually reached the texture limit for a map.

Atleast now I know there is a limit and I can reduce my scope of my levels

Appreciate the help with this Ragnar 

(1 edit)

hmmm. there isnt supposed to be a texture limit but..... efpse just being efpse i s'pose

If that is the case then I have no idea what's causing this 🤷‍♂️