Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411414 Posts in 69360 Topics- by 58415 Members - Latest Member: sophi_26

April 16, 2024, 12:13:05 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 260 261 [262] 263 264 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 737965 times)
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5220 on: March 06, 2017, 04:03:36 AM »

The problem is solved, I just need to make a recursive mesh split of quad data, that's straightforward and I have done it before, the catch is that I must roll it with other simple system to make a planet generator, but my brain don't want to follow, because I must track how all part interact Sad the dependency to what feed into what, even with "cool interface" and "encapsulation". It's just me though, I have been struggling with that since day one, and that lead me to overengineer "smart" solution just to avoid having too many part to track.

BUT there is a weird bug in blitz where a recursion return a nan when adding two type's field (float) I can go around this by reorganizing teh code, but that's where my head explode lol, I cheated by tackling problem as they come and move sub problem to function, but now I have to unroll everything to rethink it all and make it leaner instead of having jumping parameter into function depth.

I think most other people would do that in their sleep, when I see people programming and they can track where every changes they made across multiple file, even simple thing like each file is a class, which should be like a no brainer, I'm still overloaded, let alone finding line in a page full of function.
Logged

oahda
Level 10
*****



View Profile
« Reply #5221 on: March 06, 2017, 04:22:03 AM »

To be fair, that doesn't sound like the most trivial problem! And if there's a bug in your third party tools, that's not your fault. :c

As for the last point, I mean, projects can and do grow big and difficult for one person to manage! Organisation can be quite important. Not just the files and folders, but the code within the files as well.

And I'm all for comments; "self-documenting" code is nice, but it's much faster to eye a summary than having to parse a block of code to remember what it was for, and that might not at all explain why it was written the way it was, or why it exists at all, which is sometimes unclear in retrospect...

Also if your editor supports it, it's great to have the kind of special comment syntax (like Javadoc or Doxygen) that allows you to press a hotkey or hover the mouse to see the documentation comment you wrote for a particular function anywhere you call it instead of having to navigate back to the file where it was declared (tho the editors generally have a shortcut there as well), and for it automatically to show you the parameters the function wants and so on.

I haven't used Blitz in like 10+ years, so I can't say how it is now, but I can't remember it having very much of those helpful things back then at least, so maybe that's part of the issue. /:
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5222 on: March 06, 2017, 07:15:09 AM »

Thanks for the support Smiley

But the problem is really more fundamental, I psy made pass a test almost 20years ago, I have poor working memory, the problem is that it can be overload quickly and just the act of thinking to note things down can flush the memory because I'm looking for the pen and that data (looking for the pen) erase the data I want to note down leaving me hanging in blank ... It's worse with code because there is so many moving part and inspecting code trash my memory quite often, which has worsen after my long depression Sad by the time I trace down a code logic I tend to forget why I'm here in the first place :/ That's also why I'm big on procedural generation lol, It allow me to think in high level fashion and avoid details!

For the planet generation it is really simple!
- all planet are essentially axis aligned cube
- to find which face of the cube you hover, you just take the biggest coordinate (and its sign) from the planet/ship vector
- once you have the face you find the adjacent (basically discard the opposite)
- for each face you "subdivide" to create tile objects and use a magic formula to project them onto sphere surface
- subdivision mean taking the length of the edges divided by the number of division, then using the iteration variable to offset them accordingly inside the surface
- you erase tile beyond the horizon's distance (a simple trig formula)
- the remaining tile have their center computed and use to check the distance to the ship, if it's beyond a hand defined threshold (LOD), you subdivide again recursively until you reach max depth or the tile is beyond the depth distance check (each depth has a proportional distance shorter than the previous).
- use the list of tile to generate PCG noise accordingly to whatever terrain logic you have.

There is surely some optimization to do, to avoid recomputing everything everytime, but tht was my goal
Logged

oahda
Level 10
*****



View Profile
« Reply #5223 on: March 06, 2017, 07:28:10 AM »

Yeah, what works for me might not work for you. :c Maybe you can comment when you're done with the code and not in the zone anymore.

Sounds like you're making No Man's Sky! Waaagh!
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5224 on: March 06, 2017, 07:43:23 AM »

Of course I'm doing it Tongue

The code is riddle with comment, the problem is much more fundamental! that's teh pain lol Sad comment add even more clutter, nothing beat teh final code with clean lay out and proper name.

Speaking of grumpy again, naming thing in code is painful and remove me out of the flow, Everytime I have grid grid macgriddy I cry, because so many thing would like to have the same name, thinking of a name trash that memory load too Sad
Logged

diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #5225 on: March 06, 2017, 07:54:32 AM »

How long have you been programming? I feel just like you, a non programmer taking steps longer than my legs allow and feeling overwhelmed. But I have been doing this for many years (apparently I like doing this) and it's starting to get a lot easier. I have inadvertently created my own conventions. My code follows a natural structure, even my variable names do. Conventions may look like trivial things but it sure reduces the load on our minds.

Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5226 on: March 06, 2017, 03:34:30 PM »

I have been programming since I'm 17 on graphic casio calculator, I tried many scripting and language, i'm 36 now.
Logged

J-Snake
Level 10
*****


A fool with a tool is still a fool.


View Profile WWW
« Reply #5227 on: March 06, 2017, 05:34:24 PM »

Lack of memory can be compensated by coming up with better, more powerful abstractions. They have to be clean. In order to achieve that, you have to train yourself in discipline and concentration and filter out sources of distraction in your daily life, so that the fuzzy mind of yours disappears. If you manage to abstract an issue down to single points and relations between these points, then there won't be any confusion anymore since points have no extension, they are perfectly distinct.

As a side note, the trend in many popular higher programming languages has also been promoting fuzzy states of mind: It tries to make the machine adapt to the human mind. But it is the human who has to adapt to the machine.
Logged

Independent game developer with an elaborate focus on interesting gameplay, rewarding depth of play and technical quality.<br /><br />Trap Them: http://store.steampowered.com/app/375930
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #5228 on: March 12, 2017, 03:18:42 PM »

Oh my god, why don't modern operating systems have better timers?? I get that you can't always guarantee that waiting for a certain amount of time will wait for exactly that amount of time because multitasking, but unless 100% of the cpu is being used there shouldn't be delays of several miliseconds. There simply isn't a good excuse for this.

#grumpy

(also I really hate java!)
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #5229 on: March 12, 2017, 07:09:02 PM »

Oh my god, why don't modern operating systems have better timers?? I get that you can't always guarantee that waiting for a certain amount of time will wait for exactly that amount of time because multitasking, but unless 100% of the cpu is being used there shouldn't be delays of several miliseconds. There simply isn't a good excuse for this.

#grumpy

(also I really hate java!)

what is the problem you've hit?
Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #5230 on: March 13, 2017, 01:46:31 PM »

Well, I've solved it by now by just having a larger timestep. I'm just grumpy that it's impossible for modern operating systems to have a timer precision of less than ~15 milliseconds, which impacts programmers' ability to define time sensitive behavior.

To answer your question, I was trying to implement a Simon Says game in Java with swing, and was trying to have a timer with a precision of 1000 hertz. Apparently that's not possible because Microsoft can't program timer precision for ass.
Logged

zuzu
Level 0
*


View Profile
« Reply #5231 on: March 13, 2017, 02:15:51 PM »

Well, I've solved it by now by just having a larger timestep. I'm just grumpy that it's impossible for modern operating systems to have a timer precision of less than ~15 milliseconds, which impacts programmers' ability to define time sensitive behavior.

To answer your question, I was trying to implement a Simon Says game in Java with swing, and was trying to have a timer with a precision of 1000 hertz. Apparently that's not possible because Microsoft can't program timer precision for ass.

https://msdn.microsoft.com/en-us/library/windows/desktop/ee417693(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx
https://developer.apple.com/library/content/qa/qa1398/_index.html
https://linux.die.net/man/3/clock_gettime
Logged
JWki
Level 4
****


View Profile
« Reply #5232 on: March 13, 2017, 02:20:44 PM »

Yeah QueryPerformanceCounter should give you what you need?
Logged
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #5233 on: March 13, 2017, 03:00:48 PM »

I was under the influence that solving this problem was going to be impossible based on some StackOverflow answers. I was apparently wrong.

While I'm here, is there a way to have callback functions with that level of accuracy?
Logged

zuzu
Level 0
*


View Profile
« Reply #5234 on: March 13, 2017, 03:34:56 PM »

Not your fault, people on SO are often idiots  Cool

I don't think Windows has a callback API, but one can be implemented without much trouble. Just poll the time and once close enough then call whatever function is needed. Since game is probably ticking at 60hz, being less than a 60hz tick off in terms of precision should not be noticeable to users playing the game.
Logged
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #5235 on: March 13, 2017, 03:54:56 PM »

Yeah, that's a busyloop though, and I was trying to avoid that as much as possible since it wastes CPU cycles. Doesn't look like there's much of a solution around that unfortunately, and I'm probably being too obsessive about saving these precious cycles anyways.

My next endeavor after this is going to figure out how to do v-sync in Java. I suspect that I'll need to interact with OpenGL to do that. wish me luck!
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #5236 on: March 13, 2017, 11:13:39 PM »

Well, I've solved it by now by just having a larger timestep. I'm just grumpy that it's impossible for modern operating systems to have a timer precision of less than ~15 milliseconds, which impacts programmers' ability to define time sensitive behavior.

To answer your question, I was trying to implement a Simon Says game in Java with swing, and was trying to have a timer with a precision of 1000 hertz. Apparently that's not possible because Microsoft can't program timer precision for ass.

Even then. It's been a while since I've done high resolution timer stuff but IIRC at the very least windows has much better resolution than 15 msec. What functions are you calling? You mention you are using Java. I wonder if maybe their timer abstraction has issues (although even then I doubt it).

As for the busyloop stuff. Remember that in most cases there's a polling loop behind all those callbacks. Don't worry too much about it Smiley

EDIT : I was a little curious and did some googling and found this interesting site. I just worked a 17 hour day though so I'll read it in the morning when I have a relatively clear mind. http://www.windowstimestamp.com/description
Logged

Endurion
Level 2
**



View Profile WWW
« Reply #5237 on: March 13, 2017, 11:16:08 PM »

Here's a callback API: https://msdn.microsoft.com/en-us/library/dd743609(v=vs.85).aspx

All there, just need to actually look in MSDN.
Logged
ferreiradaselva
Level 3
***



View Profile
« Reply #5238 on: March 25, 2017, 09:08:38 AM »

I'm procastinating. I need to implement a renderer system (OpenGL ES), but of all tasks, this is the most annoying. I know what to do (after some googling here and there), but it's just... boring, you know? Writing shader, passing vertex/matrix...  No No NO
Logged

oahda
Level 10
*****



View Profile
« Reply #5239 on: April 01, 2017, 03:22:40 AM »

Got a "new" (used) computer and now I'm trying to get my cross-platform build environment working on here too.

It appears the Android SDK no longer works the way it used to, and my CMake module for generating an Android APK no longer works, because it relies on deprecated tools. No luck trying to download an older SDK, and there's this weird gap in the archives available on the Android Studio website, where no SDK after 2009 is up for download. Can I somehow downgrade using Studio's SDK manager? Couldn't figure out how...

But I do feel like I should just get with the times and figure out how to do this using modern tools, but there doesn't seem to be Android Studio command line tools to generate a project; it seems I have to go into the program to create one. /: I guess possibly I could create a default project and try to reverse-engineer it and generate it myself... Ugh. Unless there is an up to date APK module out there? I found this, which seems not to use the outdated tools, but I couldn't get it working...

EDIT:
Found an old enough, new enough version of the SDK on my old computer and managed to get it set up and managed to set the environment variables so that it would be used, so I'll just package that along with my build system and make it manually use that, even if other versions of the SDK might also be installed, for now. Hand Thumbs Up Right
« Last Edit: April 01, 2017, 04:18:37 AM by Prinsessa » Logged

Pages: 1 ... 260 261 [262] 263 264 ... 295
Print
Jump to:  

Theme orange-lt created by panic