Pyrian on 12/12/2016 at 23:47
Hmm. You might be getting "rotation" mixed up with "angular velocity". Rotation in this context is a component of specific, static starting positioning of the object. It does not set nor prevent any angular velocity. You can mess with it in the Unity editor in each object's Transform and see how it gets affected.
Nameless Voice on 13/12/2016 at 01:19
Quote Posted by Yakoob
Modern Indie Dev summed up :P
Modern developer, for the most part.
In most cases, you want to design your code to be readable, reusable and maintainable before you worry about performance, since most computers these days are "fast enough" anyway.
Of course, games, and especially a game's main update loop, are one of the places where performance is actually really important.
qolelis on 13/12/2016 at 01:56
Quote Posted by Yakoob
Huh interesting. Ive watched the videos too and didn't really strike me as much of a similarity? What reminded you of it?
Mostly the intro where the main character is using a machine, with a function very similar to your stamps, to redact newspaper articles before they are sent out. I would say both games have a common theme of controlling public opinion.
Yakoob on 13/12/2016 at 02:54
Quote Posted by Pyrian
Some people argue that you should
never use an infinite loop with a break statement, but I think it simplifies things a lot in certain cases. This is not one of those cases. You should probably just put "while (!gameOver)" and remove the break statement altogether.
Eh I use it every now and then. The nice thing about C++ (and c# that its derived from) is that it gives a lot of tools and sometimes you don't even know wtf it's for until one day you need it realize "oh yea!" Even global vars, theres people vehemetely against them but they have their place if you know how to use them. Singleton pattern works well for those too.
Quote Posted by Pyrian
Hmm. You might be getting "rotation" mixed up with "angular velocity". Rotation in this context is a component of specific, static starting positioning of the object. It does not set nor prevent any angular velocity. You can mess with it in the Unity editor in each object's Transform and see how it gets affected.
This. Rotation/angular velocity/angular acceleration are the equivalent of position/velocity/acceleration, just for the angle of the object.
Renz, I'd highly recommend you read a basic 3d math / physics primer - it will give you a good understanding of what all those terms mean and how they can be used in 3D space. That's about all you really need to know for game coding.
Also it's the exact same stuff as for 2D; you're literally just adding one more dimmension (z) to the formula but the whole logic and many equations are the same.
Quote Posted by Nameless Voice
In most cases, you want to design your code to be readable, reusable and maintainable before you worry about performance, since most computers these days are "fast enough" anyway..
Truth. It's always 5% of your code that is the performance roadblock, so no point optimizing stuff that will hardly yield you a fraction of a milisecond performance. I always :rolleyes: at people who complain about concating strings instead of using stringbuffers. String manipulation will NEVER be your performance bottleneck (unless your whole game is entirely text based).
Fun fact: I had some terrible hacks in Postmortem I left in. Like the whole world collision? Each tile is actually a separte cube object. Terrible quick thing I did to get it working knowing "I will optimize it once it becomes an issue." Guess what? It never became an issue. My time was better spent on coding other stuff.
Renzatic on 13/12/2016 at 04:15
Quote Posted by Pyrian
Hmm. You might be getting "rotation" mixed up with "angular velocity". Rotation in this context is a component of specific, static starting positioning of the object. It does not set nor prevent any angular velocity. You can mess with it in the Unity editor in each object's Transform and see how it gets affected.
I did. Through all this studying, it entirely slipped my mind that the asteroid rotation is handled by a rotator script attached to the prefab itself, which does include with angular.velocity. What I wrote above was me taking a random stab at a guess based upon what I read, and coming out with an entirely wrong conclusion.
Quaternion.Identity does exactly what the documentation says it does. It applies no rotation to an object. So when the asteroids spawn in, their rotations all reset to 0 on X,Y, and Z, and then tumble randomly according to the parameters set on the now spawned prefabs as they come tumbling down. In short, the GameController is only determining the default positions and rotation of all the game objects, all other fancy effects and movements are done elsewhere.
Quote Posted by Yak
Renz, I'd highly recommend you read a basic 3d math / physics primer - it will give you a good understanding of what all those terms mean and how they can be used in 3D space. That's about all you really need to know for game coding.
Yeah, that feels like the next logical step here.
Yakoob on 13/12/2016 at 07:52
RE quaternions: Yeep that's how a lot of the components in Unity are set up, each one having just a small effect so you can combined them to achieve various interesting things. It's kind of the core of component-based design (rather than having one massive "gameobject logic" loop in traditional entity models, its split into independent "legos" you strap to objects to give it properties).
Neb on 13/12/2016 at 09:43
Quote Posted by Renzatic
You painted that without any prior art experience? Damn, man. I'm jealous.
I did a few doodles, got a bit depressed about how tough it was, and then spent well over a hundred hours studying before trying again. I read Oil Painting Essentials by Gregg Kreutz, Color and Light by James Gurney, a whole load of tutorials, and many hours of Youtube videos where artists talk through their painting process ((
https://www.youtube.com/watch?v=nINus0lYQjo) like so). I'm discovering that natural talent is a bit of a myth.
Good luck with your game loop. I know the feeling of empowerment.
Matthew on 13/12/2016 at 10:00
That's really nice, Neb! Especially so given your lack of prior experience.
Pyrian on 13/12/2016 at 18:46
I had to optimize a fair amount of bits in Glade Raid. My attitude is that if I do it less than a hundred times per update, it's not worth worrying too much about. But a standard Glade Raid map has 10,000 hexes, which can easily have hundreds of fires and thousands of smoke and fog objects floating about. Fog of War, atmospheric effects, and firelight are each heavily optimized, mostly by reducing operations and references. The code is... Less clear than it might otherwise be.
Quote Posted by Yakoob
Each tile is actually a separte cube object.
Heh. I'm pretty sure collision detection works on a search algorithm, meaning that the more colliders you have, the more efficient it is per-collider. 1 collider:1X; 10 colliders:2X; 10000 colliders:5X; sort of thing. The documentation wants everyone to use edge/surface colliders, but I've always found volume colliders to be so much more robust - it's so easy to clip through a surface, and you see examples everywhere of models that partially clip through something and just go nuts.
henke on 13/12/2016 at 20:52
I have a question for the TTLG Programming Helpdesk as well.
I have this under Update:
Code:
if (Interact != "none" && MissionScreenOn == false) {
if (device.Action4.WasPressed || Input.GetKeyUp (KeyCode.Return)) {
MissionScreen (1);
}
}
if (MissionScreenOn == true) {
if (device.Action4.WasPressed || Input.GetKeyUp (KeyCode.Return)) {
MissionScreen (0);
}
}
and then later this function:
Code:
void MissionScreen (int i) {
if (i == 1) {
print ("opening mission screen");
Mission.SetActive (true);
MissionScreenOn = true;
} else if (i == 0) {
print ("closing mission screen");
Mission.SetActive (false);
MissionScreenOn = false;
}
}
My problem is that pressing Enter makes the code execute
both MissionScreen(1) and MissionScreen(0)! Shouldn't Input.GetKeyUp take care of this? So only the first one is executed on one frame? This is driving me nuts.