d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help With C++ > With Some Things
Add Reply New Topic New Poll
Member
Posts: 22,657
Joined: Dec 14 2007
Gold: 352.00
Nov 11 2013 09:54pm
So right now I'm trying to figure out how I can reduce the load time in a game I'm making in class (has around a 5+ second load time and I"m hoping to reduce that if possible)
One of my ideas is to change the map loading from tile based to just a single 800x600 png file, not completely sure if it will help or not, but it was just one the main things that came to mind as a possible reason (if anyone might have possible suggestions of what i may be doing that could be changed to reduce it lmk)

My plan to do that is to try to alter my map editor to instead save the loaded tiles into a png file instead of the numbers into a text file, but I'm not so sure how to go about doing this and hoping someone here could help me figure out a way


also something somewhat related to another class i need help with:
Need help fully understanding A*/Astar pathfinding I think I might have it mostly figured out, but some more explanations from others may be more helpful

Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Nov 11 2013 10:49pm
based on the code posted, looks like lines #148-204 are causing your performance problems. just convert the recursion to a loop and you should be fine

you need to profile you code to see which functions take the most time.
Member
Posts: 22,657
Joined: Dec 14 2007
Gold: 352.00
Nov 11 2013 11:11pm
Quote (carteblanche @ Nov 12 2013 01:49am)
based on the code posted, looks like lines #148-204 are causing your performance problems. just convert the recursion to a loop and you should be fine

you need to profile you code to see which functions take the most time.


wasn't sure if i should post it cause there is tons of code to go through across a decent chunk of header and cpp files
not to mention i have a bad habit of not commenting my code

This post was edited by douglas22888 on Nov 11 2013 11:12pm
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Nov 11 2013 11:14pm
Quote (douglas22888 @ Nov 12 2013 12:11am)
wasn't sure if i should post it cause there is tons of code to go through across a decent chunk of header and cpp files
not to mention i have a bad habit of not commenting my code


Not necessarily a bad thing w/ no comments as long as your code makes sense.

This post was edited by Eep on Nov 11 2013 11:15pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Nov 11 2013 11:16pm
Quote (douglas22888 @ Nov 12 2013 01:11am)
wasn't sure if i should post it cause there is tons of code to go through across a decent chunk of header and cpp files
not to mention i have a bad habit of not commenting my code


dont post your whole code. profileyour code first to find which x lines take up the 5 second block, then post those lines or ideas.

http://stackoverflow.com/questions/67554/whats-the-best-free-c-profiler-for-windows

http://www.cs.utah.edu/dept/old/texinfo/as/gprof_toc.html

This post was edited by carteblanche on Nov 11 2013 11:22pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll