Any under-the-hood differences between variable types?

Discussion and feedback on Construct 2

Post » Wed Feb 11, 2015 11:08 pm

I think it's important to note that if you are targeting a game for mobile, ARM based processors have a much more difficult time processing floating point numbers then integers.

It is not terribly important. This is only going to cause an issue with massive number crunching. Still, it's fascinating to know the differences and how processors handle numbers.

You might want to know the difference for other things though. For instance, floating point numbers can technically be less accurate then integer based numbers. This is a big deal for heavy accounting software. It's better to convert any moneys to pennies (for American money), do the maths, and convert it back to dollars and change.

If you venture into C++ or C land, it's important to know the differences. These languages treat memory handling far different then Java or Javascript.

With all that said though, for the scope of Construct, and as Ashley has said, it doesn't matter really.
Kurieus
Come visit and play Blast Box!
B
15
S
3
Posts: 205
Reputation: 1,349

Post » Wed Feb 11, 2015 11:20 pm

Well the other programmer who quit the project told me I HAD to make sure I got their types right and he used to be a professional programmer. I guess he's living in the past. I just was curious if it'd have an accumulative effect of specifying the wrong type for variables by the end of my game's production or not when I have like 10,000 variables. This is because I noticed he also did stuff like used for each loops wrong everywhere in the code that really impacted performance. So I was kinda doubting him but wanted to be 100% sure.

For the sake of convenience though I will be sure their types are correctly set.
B
29
S
8
G
1
Posts: 199
Reputation: 3,026

Post » Wed Feb 11, 2015 11:56 pm

Well in the context of Construct 2, you have the overhead of the entire event engine, so worrying about variable types is very much like the analogy from the blog post of cleaning your car in the hopes it makes it faster. There are definitely more useful things to think about.
Scirra Founder
B
366
S
217
G
82
Posts: 23,214
Reputation: 183,416

Post » Thu Feb 12, 2015 12:18 am

TLDR
It depends on how dirty your car is.
Image Image
B
164
S
49
G
111
Posts: 7,620
Reputation: 77,939

Post » Thu Feb 12, 2015 4:51 pm

Had I seen the new blog before answering this, I would have mentioned it. ;-)

Mythbusters Dirty vs clean car was a surprising result. Golf ball effect. Dimples are better. ;-)
http://www.discovery.com/tv-shows/mythb ... clean-car/
B
209
S
54
G
30
Posts: 897
Reputation: 37,124

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests