Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411654 Posts in 69395 Topics- by 58451 Members - Latest Member: Monkey Nuts

May 15, 2024, 11:44:19 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Time it take to compile
Pages: [1] 2
Print
Author Topic: Time it take to compile  (Read 3792 times)
initials
Level 2
**

Initials


View Profile
« on: August 26, 2010, 06:43:05 PM »

Hello,
I've been working a new game, and since I do it as a hobby, I don't really have any pros around to ask these questions to.

I want to ask about compiling games.
I'm working in Flash, AS3.0 and the more I add to this game, the longer the compile time gets. Fairly logical.

It starts to get frustrating when you make small tweaks, and have to wait to see the results.

Is this just part of being a programmer? Should I be breaking my code down into smaller parts, so I can test each small part on it's own?
Should I make it more interactive? For example, set some keys so that they increase or decrease certain parameters. I could set buttons to increase enemy speed, chances of the enemy firing a rocket etc.

As you can see it's a space ship shooter. Because the world needs another.

Thanks
Logged

Initials
VFX/Games/Music
Super Lemonade Factory, Super Lemonade Factory Part Two, Revvolvver, Four Chambers of the Human Heart.
increpare
Guest
« Reply #1 on: August 26, 2010, 06:57:59 PM »

Oh, for tweaking gameplay parameters, yes, it can be really valuable to be able to tweak stuff in real-time.  What's holding you back from doing it?  Having to recompile code to change data is generally something that's good to avoid : )
Logged
Laremere
Level 5
*****



View Profile
« Reply #2 on: August 26, 2010, 07:09:00 PM »

While I don't have any experience with flash, I think I can offer a few comments:

A longer compile time the longer the code is pretty natural for many types of programing.  There are many types of programing that don't require it though.  Unity game engine compiles code on a script by script basis so that you don't have to worry about compiling all your project at once.  Python can interpret code as it runs, so you don't have to worry about compiling your project until you want to ship it.  There are many other game engines (Torque for example) which have in bedded scripting languages, which often do not require long compile times and even may allow to add new scripts while running the game.

However the best thing do to in your case would be to add a developer console.  This would allow you to change values in game, and probably more though I'm not familiar with flash so I don't know the extent of what is possible.  I'm sure there is something somewhere about doing them in flash; Google is your friend.  Development consoles and debuggers are two things that any game dev shouldn't go without.

Lastly, post in the http://forums.tigsource.com/index.php?topic=45.0
We here at Tigsource like to be a community.  Anyone is welcome to join provided they don't act like a dick, but we do like people to introduce themselves and become a part of the community instead of just using the forums as a quick an easy answer service.  I'm sure people would love to give feedback on your game, and you probably have even more to contribute to the community, so jump on in. Wink
Logged

If a tree falls in the forest and no one is around to hear it, is sound_tree_fall.play() called?

"Everything that is really great and inspiring is created by the individual who can labor in freedom."
-Albert Einstein
Ushi-kun
Level 0
**



View Profile
« Reply #3 on: August 26, 2010, 11:47:31 PM »

Compiling time is a battle programmers do face every day. And I think, it's also the major reason why scripting languages became popular in modern days.

While, this is probably not going to help many hobby developers out there and not related to Actionscript either, but just to throw some information out that there are softwares such as incredibuild (developed by xoreax software), which makes your C++ compile times blazing fast. Basically, if you have multiple computers hooked up on the same network (which I assume a lot of people do at home and work), you can use up to 10 processor cores (be it your own or other computers) to parallel compile, which saves you a lot of time compiling.

At my current work, our project used to take about 25~30 minutes to rebuild the whole thing, but with this we managed to reduce to about 2~3 minutes to rebuild.

But ofcourse, these things cost money (definitely not cheap) and probably best for a company environment.

Wondering if anybody is aware if there's a cheaper solution (and more language support) out there.

I remember visual studio, gcc (or was it make) has some flags to turn on multicore (parallel) compiling, but not sure how they are really.
« Last Edit: August 26, 2010, 11:55:07 PM by MoOshiCow » Logged
nikki
Level 10
*****


View Profile
« Reply #4 on: August 27, 2010, 12:44:12 AM »

in the OP's case i would advice on having a few keys that change those variables, and the numbers plus variable names drawed somewhere on screen.

this would be much nicer
Logged
st33d
Guest
« Reply #5 on: August 27, 2010, 02:03:14 AM »

I have a research folder in my project folder.

That's where I develop new tech before bringing it into the project as a whole. That also helps allay compile time blues.
Logged
rudy
Level 0
*



View Profile
« Reply #6 on: August 27, 2010, 02:06:46 AM »

But ofcourse, these things cost money (definitely not cheap) and probably best for a company environment.

Wondering if anybody is aware if there's a cheaper solution (and more language support) out there.

I remember visual studio, gcc (or was it make) has some flags to turn on multicore (parallel) compiling, but not sure how they are really.

Hi

  I have similar experiences with my personal project (C++) which used to take approx 20 minutes to rebuild on P4 2.4GHz. Of course rebuilding means you compile the whole thing from scratch, where building a single file is much more faster. So splitting a project to multiple files is a must.

On some point I've tried to utilize computing power of my wife's computer which at that time was Core2 duo 2GHz. We both have Linux-es, so I used tool called distcc. I'm pretty sure it does the same thing as this incredibuild thing. Minus of distcc is that it requires the compilers on both machines produce the same (binary compatible code), so I also needed to install an i386 cross compiler on Core 2 duo computer. I used CrossToll-NG for that. The whole operation gave me approx 100% better performance than single P4. At the end I bought i7 though and it rocks.

You use -j <num of cores> with make to tell it to use more than 1 core. On i7 you would write : make -j8 assuming you have enough memory for 8 concurrently running compilers (4GB was not enough for code extensively using templates). 8GB is almost OK.

But this became a little off topic, sorry...
Logged
Sam
Level 3
***



View Profile WWW
« Reply #7 on: August 27, 2010, 06:50:42 AM »

Flash generally doesn't take very long to compile at all.  I've never had anything take more than ~20 seconds using FlashDevelop and the freely available compiler.  I recall someone else was having issues with long compile times in Flash and updating their compiler fixed it up.

Adding in interactive variables is a very good idea anyway.
Logged
cliffski
Level 0
***



View Profile WWW
« Reply #8 on: August 27, 2010, 08:11:38 AM »

This really does depend on code structure. A lot of people just stick all their code all voer the place, have everything call functions in everything else, and end up not only with buggy and messy code, but code that is slow to compile.
Essentially, getting this stuff right is the difference between just programming, and proper software engineering. A book which is gerat on this is 'Code Compelte' although tis slightly dated now.
Basically, you need to really think about what code goes where. if you get it right, the vast majority of your code is 'private' and totally isolated from any other code. In that case, changing some code in A, won't requrie B to recompile.
Sadly, theres no easy way to learn how to do all this, it mostly comes down to long experience, and looking at a lot of professionally written code.
Logged

www.positech.co.uk Maker of Democracy Kudos and Gratuitous Space Battles for the PC. owner of showmethegames.com.
voidSkipper
Level 2
**


View Profile
« Reply #9 on: August 27, 2010, 09:12:33 AM »

If you really must work with the flash IDE, pull out all your music/sound/embedded video assets while testing. You generally don't need to hear them unless that's specifically what you're working on at the time, and 90% of flash IDE's compile time appears to be converting/compressing assets rather than compiling code.
Logged
Guillaume
Level 7
**



View Profile
« Reply #10 on: August 27, 2010, 11:18:31 AM »

Even better than binding keys to value modifiers: using XML (or other data) files. This allows you to ship the game in the end without having to remove any extra code, and also opens it up to modding by enthusiastic players.
Logged
initials
Level 2
**

Initials


View Profile
« Reply #11 on: August 28, 2010, 12:31:24 AM »

Thanks for all the replies everyone.
I really wasn't expecting such a a great reply.

There are some really good tips in here that I am going to follow through with.

I'm going to introduce myself in the introduction thread and I hope to post more about my projects in the future.

Thanks everyone, you've got a really good community going on here!
Logged

Initials
VFX/Games/Music
Super Lemonade Factory, Super Lemonade Factory Part Two, Revvolvver, Four Chambers of the Human Heart.
Glaiel-Gamer
Guest
« Reply #12 on: August 29, 2010, 09:35:45 AM »

If you really must work with the flash IDE, pull out all your music/sound/embedded video assets while testing. You generally don't need to hear them unless that's specifically what you're working on at the time, and 90% of flash IDE's compile time appears to be converting/compressing assets rather than compiling code.

or just disable compression in the publish settings
Logged
Cimpresovec
Level 1
*


View Profile
« Reply #13 on: August 29, 2010, 10:46:53 AM »

Well, sometimes long compile times are also good:



This was a little off topic now, hope you don't mind.

But yea multiple files, scriptable (or at least changeble variables in application) variables and good and clean code is the way to "better" compiling.
Logged

Programming is the closest thing I have to magic.
Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW
« Reply #14 on: August 29, 2010, 02:41:17 PM »

I judge programs by how long they take to compile, the longer the better.

My favorite programs, things like GCC, WINE, the Linux kernel, etc, take hours to compile, and they're all excellent.

Coincidence?  I think not.
Logged



What would John Carmack do?
Sam
Level 3
***



View Profile WWW
« Reply #15 on: August 29, 2010, 03:20:34 PM »

Finally, a more reliable metric for how development is coming along than counting lines of code!
Logged
Laremere
Level 5
*****



View Profile
« Reply #16 on: August 29, 2010, 04:10:48 PM »

"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." Bill Gates
Logged

If a tree falls in the forest and no one is around to hear it, is sound_tree_fall.play() called?

"Everything that is really great and inspiring is created by the individual who can labor in freedom."
-Albert Einstein
Nix
Guest
« Reply #17 on: August 29, 2010, 04:12:54 PM »

"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." Bill Gates

Fantastic
Logged
HP Sauce
Level 0
**



View Profile
« Reply #18 on: August 30, 2010, 01:53:19 PM »

This is why so many people advocate data driven design and scripting languages.

If your tweak is changing the space-ship's speed or the spawn point or wave-pattern of enemy ships it should be in a file that is read or a script that is executed.

Wire up a key (for debug mode) to reload the scripts then tweaking is as easy as opening a text editor, hitting save, then your debug-mode script/file reload button.

If you can abstract a setting out to a file or script then you really should think about doing it... or get comfy with looking at the "building..." message of your chosen compiler.

Obviously that's a gross oversimplification of the process but have a Google around for good, extensive, guidance on scripting and data driven design.
Logged
Crimsontide
Level 5
*****


View Profile
« Reply #19 on: September 01, 2010, 10:10:53 AM »

Compiling time is a battle programmers do face every day. And I think, it's also the major reason why scripting languages became popular in modern days.

While, this is probably not going to help many hobby developers out there and not related to Actionscript either, but just to throw some information out that there are softwares such as incredibuild (developed by xoreax software), which makes your C++ compile times blazing fast. Basically, if you have multiple computers hooked up on the same network (which I assume a lot of people do at home and work), you can use up to 10 processor cores (be it your own or other computers) to parallel compile, which saves you a lot of time compiling.

At my current work, our project used to take about 25~30 minutes to rebuild the whole thing, but with this we managed to reduce to about 2~3 minutes to rebuild.

But ofcourse, these things cost money (definitely not cheap) and probably best for a company environment.

Wondering if anybody is aware if there's a cheaper solution (and more language support) out there.

I remember visual studio, gcc (or was it make) has some flags to turn on multicore (parallel) compiling, but not sure how they are really.

For MSVC you can use the compiler flag /MP to enable compiling across multiple cores.
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic