old thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Er det mulig å lage ting med Idris?
So, I made a game some years back in windows which was a 3D version of the flash game Shift using only old opengl with primitives, the code was terrible, and now I cleaned the renderer started all over, it used to run with 60fps locked, now it runs at 400fps with Nvidia gtx 960m with open source drivers. Here's a screenshot, I may share the windows executable, not the linux version yet, cause the code is still horrible in the parts made in windows.
some shit from this dreamincode.net
working on the string length counter
...
I also took the chance to implement modern opengl with shaders and shadows.
Given that Scala and Clojure exist and are mature, is it time to retire Java?
The red blocks are pushable, when you shift to the other side, they are holes
Keep forgetting to add the pics. And forgot to mention, it's made in C with only glew and SDL2 as a dependency, though I'll want to get rid of it since I only use it for threading and creating the window.
>Scala
>Mature
Java should've been retired 10 years ago
...
I'm jealous of your dedication. I can never get anywhere. I just know a lot but I sit down with opengl and get maybe half the features I want in the renderer/shader pipeline/texture upload system and then I quit.
Being able to finish something non-trivial must be nice. I'm stuck using other people's code if I want to get something done.
nice. I made something like this, but not nearly as pretty. I got around 40FPS on my Riva TNT2
Scala is very mature, they even fixed List(1, 2, 3).toSet() evaluating to false.
does yours have any multiplayer?
Thanks, I'm still thinking of using the remaining FPS's for reflections and ambient occlusion, or anything else I may remember. In the original version, at the end of each level there is a door where, like in portal, you could see the next level, used stencil maps to do it, don't know if I'll do it in this version though, too much of a waste of FPS I think.
listOfSonsAndNotice is an array list of sonsAndNotice,
sonsAndNotice is an object containing 2 int's, simple.. getID() returns one of those ints, and getNotice() the other int.
String sonsAndNoticeAsString = "sons by ID followed by their notice: ";
for(int i = 0; iinb4 im retarded
Yeah you could profile your code and deal with it better.
I'm not aiming to insult but you'd be surprised by how some very basic optimizations can make your game go. If you just profile it and look for solutions.
What's with your stupid variable names
Is the source code posted anywhere?
I thought about implementing it, already am familiar with that sort of networking, though it would mean I would have to fix some things, for instance, I am generating only the walls between matter and air, and when I move a box, I am basically re creating the walls without the box, so I can have it animate between tiles, so the one moving is just a cube, only when it arrives at the grid space does it become part of the walls again, which means, if there was another player, he could be on the other side and should see a hole moving, when as it currently is, he would just see the hole disappearing and appearing a bit forward.
Thanks for the input, but of course I am aware of this, last week, optimizations is all I've been doing. and on the original one, I still used frustum and occlusion culling not to draw the next level when the door wasn't being seen, still, maybe there is a cheaper way of doing things.
As I stated above, the old parts of the code are the worst things I've ever done in my life and I wouldn't share it with anyone, that being said, maybe in two weeks or one I will have made it acceptable and I'll share it with you guys.
Looking forward to it
its been a long day, and I had to move fast and keep track of what things were without putting in notes.
I fixed it.. No need to fucking use toString() on int lol
Also, a foreach loop will be much cleaner. Write something like this:
String sonsAndNoticeAsString = "sons by ID followed by their notice: ";
for (SonsAndNotice s : this.listOfSonsAndNotice) {
sonsAndNoticeAsString += " " + Integer.toString(s.getID()) + " "" + s.getNotice().toString());
}
If you want the windows version, it's in this link, though the initial screen is a bit bugged. It has a level creator, which I was hopping would allow for sharing the levels online, though it was never finished, and there is a login screen in the beginning which is trying to connect to something which no longer exists, making the screen lag in the menu. Beyond that, it's actually playable.
mega dot nz/#!mlgQRQKa!fftbyLQpDa45gwHw1S-9z2ogNx4kB8qeSqT3fWJoT8E
If anyone has a spare virtual machine to try it out, I too wouldn't trust executables sent by Sup Forums.
Pic related is from the windows old version.
ty based user!
This is what new code looks like.
I'm going to see if this works with WINE
This is what some of the old code looks like.
Forgot pic
Really doubt it.. by the way, most of the weight of the file, is just some tracks from all of the flash games, which I for some reason did not change into a compressed format...
Something I also want to do before making the code available, is maybe get rid of the Shift trademark. I talked with the original creator, he said he didn't have the rights, ArmorGames did, but that I could steer away from the style, and say it was based on the game the flash Shift was based on.
WINE made it segfault
darn
It used to fail to run on some windows 7 machines as well, so I'm not impressed at such outcome, thanks for trying anyway!
Maybe I'll pop over to windows and just record a walkthrough.
what editor is that fampai?
It's vim, I swapped computers, so the tab colors are just wrong.
>not using StringBuilder
r8 my code Sup Forums
/**
* @param n n
* @return d on success, -1 on failure
*/
int64_t f(uint8_t n)
{
if (n 92) return -1;
n -= 2;
uint64_t a = 1, b = 1, c = 0, d = 1, e = 1, f = 0;
while (n) {
uint64_t g, h;
if (n & 1) {
g = a * d + b * e;
h = b * d + c * e;
f = b * e + c * f;
d = g;
e = h;
}
g = a * b + b * c;
a = a * a + b * b;
c = b * b + c * c;
b = g;
n >>= 1;
}
/* return d */
return d;
}
>not using Cord
Change the doxygen comment to be more descriptive. Why make the user aware of a local variable? Make it obvious what result it returns.
/**
* @param n n
* @return the result on success, -1 on failure
*/
int64_t g(uint8_t n)
{
if (n 92) return -1;
n -= 2;
uint64_t a = 1, b = 1, c = 0, d = 1, e = 1, f = 0;
while (n) {
uint64_t g, h;
if (n & 1) {
g = a * d + b * e;
h = b * d + c * e;
f = b * e + c * f;
d = g;
e = h;
}
g = a * b + b * c;
a = a * a + b * b;
c = b * b + c * c;
b = g;
n >>= 1;
}
/* return d */
return d;
}
I have a a working client for my VOIP protocol now, and I'm working on it now since I failed to sleep.
Much better.
very cool but
>that gamma
even if you want an edgy art style you could probably do better with tone mapping rather than just leaving the gamma untouched
ITT: languages which sound great at first, but when you get down the rabbit hole, they're actually awful and unusable
I'll start
>haskell
>python
>go
forgot lisp too
Python isn't that bad, it's what I use for my VOIP client server.
Exactly right, you should learn a practical language even if it's uncool. There's a reason Java and C# are so widely used.
French
>haskell
>awful
>unusable
i don't follow
>make deals with everyone to use your shitty product
>people wanting to work learn your shitty product because everybody else uses it
>surprised when its used widely and hinders actual progress
these + C# + irrelevant meme languages
For something more than a math problem
try doing anything IO
it will require being a category theory expert
performance is worse than python
why should I use this crap
no it doesn't
English
>to put
>to put on
>to put off
>to put down
>to put up
>to put up to
>to put upon
>to put it to
>to putt
by "performance is worse than python"
do you mean
"performance is worse than C"
>hurrdurr monad transformers
>durr MONADS
monad is a meme buzzword, nobody understands it
Thanks for the tip!
Just did a full walkthrough only to find camstudio saved only 1fps...
do
putStrLn "I'm doing IO"
putStrLn "Holy shit"
All of those make perfect sense
Deutsche ist doof
see
but you're not
A monad is just a monoid in the category of endofunctors, what's the problem?
Next you'll be saying you don't even understand zygohistomorphic prepromorphisms.
Technically correct, just like in any other programming language you write code and the computer compiles and runs it and does the actual I/O.
long long long long long long long long long long benis;
Kek
laffd
/dpt/ users don't even understand anamorphisms/catamorphisms. You can't expect them to understand anything more technical.
Mummy you're posting in your sleep again.
>he thinks basic kiddo IO examples reflect real world IO
its even worse than java
>>actually outputting data to the console
>>ever useful in any real world context
the only thing going for it is the nice syntax and meme constructs such as "pattern matching" or "function composition"
and maybe purity
>meme constructs
>implying the point was printing to the screen, not the ease of composing IO actions
(you)
you can't even defend you shirty language
how about the packing and unpacking of data while the context of IO?
have fun with
do
t >= no_real_world_use
worst_lang = gay_balls kill_me
return (slow_performance worst_lang)
if pattern matching is a meme, then do you never use if statements or switch cases?
type classes
>everything is a meme until it becomes popular
wow
1666
833.0
2500.0
1250.0
625.0
1876.0
938.0
469.0
1408.0
704.0
352.0
176.0
88.0
44.0
22.0
11.0
34.0
17.0
52.0
26.0
13.0
40.0
20.0
10.0
5.0
16.0
8.0
4.0
2.0
1.0
took this many steps 30
Newbie question, is there a similar function for string::assign except for ints in c++? Im trying to edit the elements of an array from a pointer thats passed as a parameter
This is why you learn C instead.
I was working on a Control Template in WPF, but that fucking xaml is just so damn ugly and unreadable that I abandoned that shit.
How could I maintain an "overgrown jungle"?
Trying to get webcam input through V4L2 in C++
array[x]=whateveryouwant
string::assign changes the size of the underlying buffer. Is this what you are trying to do?
XAML is comfy desu, before rolling your on control template you should check thoroughly the library.
>How could I maintain an "overgrown jungle"?
MVVM, and try to re-use styles.
what programming language will help me have sex with cute girls?
javascript
Took me way too much time to record this, here it is, tell me what you think!
youtube.com
I would have stayed with C to be honest but for this class and my class next semester it needs to be an object oriented language.
This is what I originally tried but I get incompatible assignment type 'int' to 'int[20]'.
Honestly im not sure, I guess my takeaway from this is is that I should probably stay off here until im more knowledgable
Thank you guys for the replies
this isn't true!
processing complete, finally
>object oriented LANGUAGE
heh
(*array)[x] = whatever
learn pointers you idiot, they're easy
Wrong reference, sorry user.
C, because C is like lolis: Cute, small, and never gets old.
Haskell
I just finished the BIGGEST programming assignment I ever had to do for a class
3 days nonstop dawn to dusk on my desk. My head hurts and my back aches, but it's fucking done now.
I've learned more about network programming these last few days than over all the years I've been programming in my own time, it's pretty shocking what deadlines make you do.