Jump to content

Devnote Tuesday: Smashing Buttons


SQUAD

Recommended Posts

12 minutes ago, NathanKell said:

Yep! Order of preference is:

for(int i = foo.Count/Length - 1; i >= 0; --i) // this saves a STO

followed by

int fC = foo.Count/Length;

for(int i = 0; i < fC; ++i)

and only then by other for styles let alone foreach.

So what would you recommend for a list?

Link to comment
Share on other sites

11 minutes ago, kiwi1960 said:

News of 1.2 is annoying.... NO MORE RESTARTS DAMMIT!

It's not a restart, and no one is forcing you to use the newest version of the game. Play 1.0.5 forever if that's what makes you happy. 

But I for one welcome the plans of increased stability, better performance, and new mechanics. Thanks @SQUAD for all the hard work, and for continuing to give us updates for free

Link to comment
Share on other sites

1 hour ago, Shadowmage said:

Indeed;  while a simple foreach(foo in bar) {}  may -look- like simpler construct; behind the scenes there is all sorts of ugliness with instantiating an iterator object... which then has to be garbage collected.  Add that to every spot that for-each is used... and you are quickly drown in single-use garbage objects.  As such I only use foreach in places that I expect to only run once in a great while, or while working up prototype code (which has proper for loops inserted before moving to production).

It can also help to define your length test variable prior to starting the for loop; at least in the earlier days of memory-managed languages (and java in particular) - declaring the length check variable outside of the for loop will result in it not rechecking a list.length every iteration and merely checking vs. the cached length variable; depending upon the list implementation this could have substantial cpu impact.

I learned all of this all-too-well while learning the Android development environment.  Zero-allocation-loops was just about the only way to do it on 'droid, as the garbage collector was (at least in 4.xxx) very, very... so terribly slow.

...I am *so* far out of touch, having learned my coding on a Commodore 64 and using if/then for 90% of what I wanted to do.  This makes my eyes spin back. lol  :P

Just, ...do good baking.  I'll enjoy the kitchen smells from the living room.  :wink:

 

Link to comment
Share on other sites

31 minutes ago, Arsonide said:

We prevented the suspension raycasts from reacting to the presence of the kerbal, which helps prevent the vessel from launching when this happens

In 1.1, you kick vessel. In 1.1.3, vessel kicks you! :D

(but seriously now) The raw footage that clip came from also had a couple instances of wheels that didn't kick a kerbal. That made me wonder if the landing struts were just forgotten in the suspension adjustments, or were otherwise treated differently from wheels.

I suppose this isn't as absurd as phenomena I saw in 1.0.5, where a kerbal could push the lower part of the strut up into the upper part and stand under it. "Look at me, I'm Superkerbal."

Link to comment
Share on other sites

2 hours ago, Gordon Fecyk said:

Wheels appear fixed but landing legs, not so much.

--

Hmmmm not sure Neil or Buzz every had to worry about that happening. Although, I feel it is the kind of hazard a half decent OH&S committee could solve with a yellow government-mandated sign: 

"WARNING - Unexpected Acceleration Danger 

Contact with landing legs may lead to injury or death.

Work safety is everybody's responsibility.

Call 1800-Kerbal-Safe for more information." 

 

 

Edited by Tourist
Link to comment
Share on other sites

34 minutes ago, Tourist said:

Hmmmm not sure Neil or Buzz every had to worry about that happening. Although, I feel it is the kind of hazard a half decent OH&S committee could solve with a yellow government-mandated sign: 

"WARNING

Contact with landing legs may lead to injury or death.

Work safety is everybody's responsibility.

Call 1800-Kerbal-Safe for more information." 

 

 

And the inevitable chalkboard sign...

2

2

2

2

1 day(s) accident free!

Link to comment
Share on other sites

1 hour ago, Arsonide said:

for(int i = foo.Count - 1; i >= 0; --i)

or 


for(int i = 0; i < foo.Count; ++i)

 

I got that, but referencing a list using myList.ElementAt(i) is using Linq.  Can I assume that using:  foo would work?  

Still learning some stuff about c#

Link to comment
Share on other sites

1 hour ago, WhereAmI said:

According to a anonymous member on the local ksp forum, it has already been stated by the devs that reworked rocket parts won't make it into 1.2. Is that info correct?

Yes, I was wondering about this myself. Can we at least get switchable tanks (a la Stock Fuel Switch) for fueling our NERVs?

Edited by StrandedonEarth
Link to comment
Share on other sites

2 hours ago, Foxster said:

That's all great...but when is KSP going to have some more content? 

I see we are getting the long-awaited antenna stuff "soon" but that is pretty much already available as a mod, so I'm struggling to get excited about it. The only other thing seems to be the Asteroid Day mod - which is not new. 

Apart from the new heat shield, it seems a long time since there has been some major new stuff. Now that we have a stable platform and the ability to support more stuff, how about some more planets, another solar system, space aliens, buildings all over Kerbin, a lot of new parts, lots of things to discover on the planets, subterranean caverns, green alien dancing girls...

 

2 hours ago, Arsonide said:

New stuff is just as fun to develop as it is to play, so we're definitely with you when it comes to being more fun. However, if we keep churning out new stuff without occasionally pausing to polish up the old stuff, we start accruing what is known as "technical debt". This means that things become harder and harder to work with, and bugs become easier to introduce and harder to fix.

You don't want that, and neither do we, which is why we have these refactoring periods. This is especially true after a patch of such earth shattering proportions as 1.1 was.

Plus optimizations improve the game for people who don't have a computer more powerful than the cia supercomputer. also, MOAR OPTIMAZATIONS MEANS MOAR BOOSTERS AND MOAR STRUTS (sorry for the caps, i felt it was necessary) 

Link to comment
Share on other sites

1 hour ago, FullMetalMachinist said:

It's not a restart, and no one is forcing you to use the newest version of the game. Play 1.0.5 forever if that's what makes you happy. 

But I for one welcome the plans of increased stability, better performance, and new mechanics. Thanks @SQUAD for all the hard work, and for continuing to give us updates for free

By restarts..... I mean having to restart my entire game from scratch... as is always the case, it seems.

Link to comment
Share on other sites

Nice Devnote.

I'm looking forward to a delivered article every week.

I will expect the periodical upgrading of the game, additions of function to enjoy trips to space (also of the Kerbin), and addition of the multiplayer in near future.

Best wishes to developers and the universe!

Edited by EBOSHI
Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

I got that, but referencing a list using myList.ElementAt(i) is using Linq.  Can I assume that using:  foo would work?  

Still learning some stuff about c#

just myList[ i ]

 

Also per what @Shadowmage said it's better not to recheck the Count each time, that's why my two examples you quoted in each case referenced Count only once. I said Count/Length in the hope that it would be clear that the examples I provided worked equally for Lists and Arrays respectively.

Link to comment
Share on other sites

1 minute ago, NathanKell said:

just myList[ i ]

 

Also per what @Shadowmage said it's better not to recheck the Count each time, that's why my two examples you quoted in each case referenced Count only once. I said Count/Length in the hope that it would be clear that the examples I provided worked equally for Lists and Arrays respectively.

I got the thing about rechecking the count, thanks

And am well on my way to removing all the foreaches in PDPN (new mod under development)

Link to comment
Share on other sites

4 hours ago, SQUAD said:
removing old foreach() loops, Singletons and generally de-linqing the game. We recommend that modders to the same in anticipation of the next update to help increase performance for all KSP players. Linq and foreach() loops in particular create a lot of garbage, which is what causes the stutter that some people experience while running the game.

Thanks for the official acknowledgement of The Stutter and details on plans for improving it, not to mention guidance for modders. De-garbaging the core game will help a lot, but it will only take one garbage-prone mod to gum everything back up again. It's nice that the game is at a point where this can receive attention!

Link to comment
Share on other sites

4 hours ago, HoloYolo said:

I think why they are not adding more stuff is that a majority only want bug fixes and optimizations. I want more stuff as well, but new features get overshadowed by "Why don't we just improve the old stuff". It sucks.

 

4 hours ago, Foxster said:

That's all great...but when is KSP going to have some more content? 

I see we are getting the long-awaited antenna stuff "soon" but that is pretty much already available as a mod, so I'm struggling to get excited about it. The only other thing seems to be the Asteroid Day mod - which is not new. 

Apart from the new heat shield, it seems a long time since there has been some major new stuff. Now that we have a stable platform and the ability to support more stuff, how about some more planets, another solar system, space aliens, buildings all over Kerbin, a lot of new parts, lots of things to discover on the planets, subterranean caverns, green alien dancing girls...

I know it's been addressed already, but let me use an analogy I like:

You want to build your dream home. You know what you want in it and what the end result should be. You could just build it as-is, but it'll fall apart if you did: You first need a good, solid foundation to build that house on so you have a complete home. A lousy or no foundation will mean the house will just fall apart at the first sign of trouble.

KSP the game in the home. The engine is foundation, the content is the house built on top of it. Anyone who has an inkling of what the development of KSP was like knows the foundation wasn't very good: it was essentially hacked together on an game engine platform fairly ill-suited for it. And it was an ambitious project to boot. So imagine trying to build something like the Great Pyramids of Giza on swampland without prepping the land first. Possible, but you're gonna hate yourself in the process.

SQUAD now has the experience and manpower to do the game correctly now. Let them do that. KSP is a complex "game", make no mistake about it. It's a physics simulator dressed up as a game. (A bit different from a physics-based game, mind you.) Bad programming in KSP is not something that you can hide by say brute forcing it with a high-end CPU to mask lag and slowness. (Made evident by the fact that multi-threading in Unity is pretty... Lackluster...)

I'd rather have a nice, rock-solid home that's a little bare and plain than a fancy one that'll fall apart on and around me if I so much as look at it wrong. Prioritizing content when you can't even make full use of it due to issues in the game is just utter non-sense. You can make all the content in the world for a game, but if the game is broken, the content means and does nothing for anyone.

Of course, the problem with my analogy is that the home was already built on a weak foundation. So now they need to go back and remodel it without completely tearing it down and rebuilding it from scratch. Because the house is mostly what they want, but the foundation needs (serious[?]) work.

So I ask you: what kind of home would you prefer?

Link to comment
Share on other sites

4 hours ago, Gordon Fecyk said:

Wheels appear fixed but landing legs, not so much.

--

I can see a lot of comedy from that :D

4 hours ago, JPLRepo said:

Roses are red Viloets are blue I don't understand computer science,but obviously you do!
Violets is spelt wrong.
 


010100100110111101110011011001010111001100100000011000010111001001100101001000000111001001100101011001000010000001010110011010010110111101101100011001010111010001110011001000000110000101110010011001010010000001100010011011000111010101100101001000000100100100100000011001000110111101101110001001110111010000100000011101010110111001100100011001010111001001110011011101000110000101101110011001000010000001100011011011110110110101110000011101010111010001100101011100100010000001110011011000110110100101100101011011100110001101100101001000000010110000100000011000100111010101110100001000000110111101100010011101100110100101101111011101010111001101101100011110010010000001111001011011110111010100100000011001000110111100100001

and here is one for you @Glaran K'erman


01010011011011110110110101100101001000000110111101100110001000000111010101110011001000000111010101110011011001010110010000100000011101000110111100100000011100000111001001101111011001110111001001100001011011010010000001100011011011110110110101110000011101010111010001100101011100100111001100100000011010010110111000100000011000100110100101101110011000010111001001111001001000000111010101110011011010010110111001100111001000000110000101110011011100110110010101101101011000100110110001100101011100100010000001100001011011100110010000100000011100000111010101101110011000110110100000100000011000110110000101110010011001000111001100101110

 

01010010 01101111 01110011 01100101 01110011 00100000 01100001 01110010 01100101 00100000 01110010 01100101 01100100 00100000 01010110 01101001 01101111 01101100 01100101 01110100 01110011 00100000 01100001 01110010 01100101 00100000 01100010 01101100 01110101 01100101 00100000 01110111 01101000 01111001 00100000 01110101 01110011 01101001 01101110 01100111 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100001 01110011 01100011 01101001 01101001 00100000 01100001 01110011 00100000 01110111 01100101 00100000 01100100 01101111 00111111 00001010 01010010 01101111 01110011 01100101 01110011 00100000 01100001 01110010 01100101 00100000 01110010 01100101 01100100 00100000 01010110 01101001 01101111 01101100 01100101 01110100 01110011 00100000 01100001 01110010 01100101 00100000 01100010 01101100 01110101 01100101 00100000 01101010 01110101 01110011 01110100 00100000 01100111 01101111 01101111 01100111 01101100 01100101 00100000 01110011 01101111 01101101 01100101 00100000 01100001 01110011 01100011 01101001 01101001 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100011 01101111 01101110 01110110 01100101 01110010 01110100 01100101 01110010 00100000 01110100 01101000 01100001 01101110 00100000 01111001 01101111 01110101 00100000 01100011 01100001 01101110 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100000 01110100 01101000 01110010 01101111 01110101 01100111 01101000 00101110

Link to comment
Share on other sites

42 minutes ago, Kerbuvim said:

What about consoles? Great silence...

7 hours ago, SQUAD said:

Speaking of our QA team: Steve (Squelch) has been flown in to Mexico to do some intensive testing on consoles to complement the same work Mathew (sal_vager) is doing in the UK. They’ve found a few issues that have now been resolved and are looking forward to the day of release.

That's what we know 'bout consoles. Not quite a "great silence," but also not particularly talkative either.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...