[QUOTE=thrawn2787;50019047]Well I think as someone else said it depends on what you wanted to do.
If you wanted to make a physics engine you should've stuck with it.
If you wanted to make something using physics then yeah reinventing the wheel probably isn't worth the time and effort.[/QUOTE]
I could easily enough go back and try it again later on down the line if I ever feel the need, I have plenty of commits.
All I need to do now is clean up the code, tie in the engine's gravity and air friction to the physics engine, and then set up some practical examples, such as a player and some actual models.
Then its onto another branch, such as either networking, or audio.
[QUOTE=Zelpa;50018360]on another note, how would you print to the screen and print to an output file at the same time? all of the tutorials i've found look really hacky.[/QUOTE]
Why not just print twice? Once to file and once to screen.
[QUOTE=Zelpa;50018360]on another note, how would you print to the screen and print to an output file at the same time? all of the tutorials i've found look really hacky.[/QUOTE]
Python has a built in logging library [url=http://stackoverflow.com/questions/13733552/logger-configuration-to-log-to-file-and-print-to-stdout]which you can use to do just that[/url]. I've not used it but I imagine it's the "proper" way to log to multiple places.
I'd probably just write a function for each of your writing tasks and pass your info to those functions so you can just do a "WriteToScreen(data)" followed by a "WriteToFile(data)"
or use tee
[QUOTE=Zelpa;50018360]i made a quick python script to generate multiple versions of my famous catchphrase because i couldn't be bothered to do it myself
[code]import random
choices = ["'s always ", "'s only ", "'s never ", "'s kinda ", " isn't ", "'s really ", "'s sorta ", "'s only a BIT "]
days = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "weekday"]
daythings = ["on a", "a", "close to", "near a"]
slank = input("Enter a number of passages to generate: ")
log = file('out.txt', 'w')
for i in range(slank):
print >> log, "it" + (random.choice(choices)) + "gay if it's", (random.choice(daythings)), (random.choice(days))[/code]
which outputs stuff like
[code]it isn't gay if it's near a weekday
it's kinda gay if it's near a monday
it isn't gay if it's a thursday
it's only a BIT gay if it's close to monday
it's only a BIT gay if it's near a tuesday
it isn't gay if it's a monday
it's kinda gay if it's near a wednesday
it isn't gay if it's near a tuesday
it's only a BIT gay if it's close to thursday
it isn't gay if it's near a tuesday
it's really gay if it's on a tuesday[/code]
i accidentally generated 10 million and the output file was 365mb, but it only took like 30 seconds so that's nice. on another note, how would you print to the screen and print to an output file at the same time? all of the tutorials i've found look really hacky.[/QUOTE]
Print to stdout in console; print to stderr, redirect/pipe to file. You can do this in both powershell and bash
Integrated the velocity buffer into the main engine and added support for skeleton animated objects. Still got some bugs to squash but it's been a fun ride so far.
[img]http://puu.sh/nX7KB.gif[/img]
Video with motion blur and some IK stuff:
[video=youtube;twcH4i5c1kQ]https://www.youtube.com/watch?v=twcH4i5c1kQ[/video]
god yes it feels so good to start a side project where I can hardcode everything and generally write shitty code
[QUOTE=fewes;50021393]:magic101:[/QUOTE]
I just wanted to say your art style is really neat, and the animations only compliment that. I think more comic book games should look like this.
This morning I discovered [url=https://nodequery.com]NodeQuery[/url]. It's a simple Linux script that reports the health of your server to them and you can view it all via their website. I noticed they had an API, so I've been working on a little widget you can put up wherever. I plan to add themes so you can make it look how you want, adjust the size, show whatever information from the server you want on it, etc.
[url]https://github.com/kurozael/nodequery-widget[/url]
It kind of looks like this (pretty ugly and not much information at the moment):
[img]https://camo.githubusercontent.com/1119ae244759183758be90c221307317ff00227f/687474703a2f2f692e696d6775722e636f6d2f78474c6b4457372e706e67[/img]
[thumb]http://www.carp.tk/~anon/files/1459203882.png[/thumb]
Now if it only didn't hang in NtWaitForAlertByThreadId :cry:
[img]http://www.carp.tk/~anon/files/1459204134.png[/img]
[QUOTE=Syntox;50017085]Tried my hands at some beat detection. I followed the famous [URL="http://archive.gamedev.net/archive/reference/programming/features/beatdetection/index.html"]gamedev article[/URL].
This is also my first "big" project in c++, so the [URL="https://github.com/Syntox32/Visualizer"]code[/URL] is an absolute mess.
It's still rusty, but it's at least responding to something, and it's looks kinda cool :v:
[video=youtube;6osg3BHfjpA]https://www.youtube.com/watch?v=6osg3BHfjpA[/video][/QUOTE]
I did a similar thing by essentially taking the Fourier transform of the Fourier transformed audio signal. The first transform gets you the frequency bins to look at and the second transform looks at the cyclical nature of those results. I can't find it now but theres a good article somewhere better describing this method.
[QUOTE=Zelpa;50018360]i made a quick python script to generate multiple versions of my famous catchphrase because i couldn't be bothered to do it myself
[code]import random
choices = ["'s always ", "'s only ", "'s never ", "'s kinda ", " isn't ", "'s really ", "'s sorta ", "'s only a BIT "]
days = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "weekday"]
daythings = ["on a", "a", "close to", "near a"]
slank = input("Enter a number of passages to generate: ")
log = file('out.txt', 'w')
for i in range(slank):
print >> log, "it" + (random.choice(choices)) + "gay if it's", (random.choice(daythings)), (random.choice(days))[/code]
which outputs stuff like
[code]it isn't gay if it's near a weekday
it's kinda gay if it's near a monday
it isn't gay if it's a thursday
it's only a BIT gay if it's close to monday
it's only a BIT gay if it's near a tuesday
it isn't gay if it's a monday
it's kinda gay if it's near a wednesday
it isn't gay if it's near a tuesday
it's only a BIT gay if it's close to thursday
it isn't gay if it's near a tuesday
it's really gay if it's on a tuesday[/code]
i accidentally generated 10 million and the output file was 365mb, but it only took like 30 seconds so that's nice. on another note, how would you print to the screen and print to an output file at the same time? all of the tutorials i've found look really hacky.[/QUOTE]
Just open the file as an object, which also handles closing the file automatically.
[code]
from __future__ import print_function
import random
choices = ["'s always ", "'s only ", "'s never ", "'s kinda ", " isn't ", "'s really ", "'s sorta ", "'s only a BIT "]
days = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "weekday"]
daythings = ["on a", "a", "close to", "near a"]
slank = input("Enter a number of passages to generate: ")
with open("out.txt", "w") as f:
for i in range(slank):
dank_catchphrase = "it{}gay if it's {} {}\n".format(random.choice(choices), random.choice(daythings), random.choice(days))
f.write(dank_catchphrase)
print(dank_catchphrase, end="") # Prevents double newlines.
[/code]
So I started learning OpenGL 3 after only ever having used OpenGL 2, and ended up having a dream where I was dueling a wizard while calling out spell names: "Transform Feedback!" "Fireball!" "Memory Barrier!" "Compute Shader!"
Change is scary.
[QUOTE=Dolton;50024530]I did a similar thing by essentially taking the Fourier transform of the Fourier transformed audio signal. The first transform gets you the frequency bins to look at and the second transform looks at the cyclical nature of those results. I can't find it now but theres a good article somewhere better describing this method.[/QUOTE]
Fourier transform of Fourier transform is just original signal, but inverted orded..
Maybe you mean cyclical-auto-correlation, where you take fourier transform, then multiply real and imaginary part (you get power spectrum), then take fourier transform again.
Edit:
If u wish to have non-cyclical-auto-correlation, then you need to pad your vector with zeros before applying FFT.
To find "tempo" or periodicity, you search for first peak/maximum in that auto-correlated vector.
I'm starting out with my data structures class and this is the first Java example (main language of the course, but at least it's not Pascal):
[code]public boolean contains (int[] s, int c)
{
boolean b = false;
for (int i = 0; i < s.length; i++)
if (s[i] == c) b = true;
return b;
}[/code]
Notice anything? The course text only says it's "obviously clumsy" [I]13 pages later[/I].
I think I understand now why so many people with CS degrees are terrible developers :cry:
I don't notice anything wrong with that code. Could you explain?
you need to return as soon as c is found.. it's one of optimization.
Not sure why it would be clumsy though.
[QUOTE=Fourier;50026090]you need to return as soon as c is found.. it's one of optimization.
Not sure why it would be clumsy though.[/QUOTE]
Probably because it uses a plain for loop. Java's verbose enough as it is :v:
[code]public boolean contains(final int[] s, final int c) {
for(final int i : s) {
if(i == c) {
return true;
}
}
return false;
}[/code]
[QUOTE=Fourier;50026090]you need to return as soon as c is found.. it's one of optimization.
Not sure why it would be clumsy though.[/QUOTE]
Just citing the text (and translating it), but yes, that's the thing they remark.
That aside though... I don't think this class is going to use anything that could be called self-explanatory code.
In the whole two-week lecture there are only examples with either single-character names or ones that are shortened like what you'd see in C(++), which is normally widely discouraged in Java (because almost everyone uses an IDE anyway, and it's just plain easier to understand if you don't cut words in half all the time).
The course seems to take a "teach it wrong first and then correct it" approach, which is incredibly discouraging to me.
On the plus side the bar is so far so low I managed to get through the material in 30 minutes (but I have ample experience with this stuff).
[editline]29th March 2016[/editline]
[QUOTE=fauxpark;50026107]Probably because it uses a plain for loop. Java's verbose enough as it is :v:
[code]public boolean contains(final int[] s, final int c) {
for(final int i : s) {
if(i == c) {
return true;
}
}
return false;
}[/code][/QUOTE]
That's another reason. The code is simplified to the point of using the wrong tools for the job, and this isn't remarked [I]at all[/I] in the currently shipped material.
[QUOTE=Fourier;50026090]you need to return as soon as c is found.. it's one of optimization.
Not sure why it would be clumsy though.[/QUOTE]
I see, thank you for explaining
I hope they won't ban sane code in the test, as they probably did with Pascal. Personally I'd write this as follows, btw (now that I know method parameters and (loop) variables can be [I]final[/I], since I never saw that at work): [code]public static boolean contains(final int[] set, final int value)
{
for (final int item : set)
{ if (item == value) return true; }
return false;
}[/code]
It's been a while since I used Java though, so I don't know how the default auto formatter behaves regarding this code or how the documentation comments work.
It's Java, you will be fine.
final == const
[QUOTE=Fourier;50026212]It's Java, you will be fine.
final == const[/QUOTE]
I use C# normally so it would be [I]readonly[/I] (and C# doesn't let you do this for parameters (since there's no actual guarantee once reference objects are involved and value types are by-value anyway) or loop variables).
Otherwise yes, I worked a few months in a Java job so I'm confident in my ability to pass this course. I just never want to touch the language again, but that's a different matter. What's disconcerting to me is mostly that the material seems to promote just about every bad habit imaginable.
coding in Java is bad habit, agreed
[QUOTE=mojangsta;50021924]god yes it feels so good to start a side project where I can hardcode everything and generally write shitty code[/QUOTE]
To be honest i think writing things messily is the best way to go until you get your head around concepts. I always spend about 3 days going 'hmm what do i write this in, hows it organised, what if this happens' otherwise when i should just be creating concepts.
[QUOTE=fewes;50021393]Integrated the velocity buffer into the main engine and added support for skeleton animated objects. Still got some bugs to squash but it's been a fun ride so far.
Video with motion blur and some IK stuff:
[video=youtube;twcH4i5c1kQ]https://www.youtube.com/watch?v=twcH4i5c1kQ[/video][/QUOTE]
friend: I like it but I almost can't take it seriously. The leg animations remind me of qwop
apart from that, it looks lovely; I love the way the flags in the background move, it adds a sense of realism to the whole thing. Also, I'm assuming the guy is a placeholder?
Fairly new to assembly. Working my way up to doing something animated on the screen, but so far just testing the waters and building up to something I can use.
[code]
.MODEL small
.STACK 256
.386
.DATA
param_1 DW 0
param_2 DW 0
param_3 DW 0
param_4 DW 0
dummy_1 DW 0
dummy_2 DW 0
dummy_3 DW 0
dummy_4 DW 0
colour db 1
startaddr dw 0a000h ;start of video memory
.CODE
_syscall:
int 21h
ret
_PrintNumber:
push bp
mov bp, sp
sub sp, 1
push ax
push bx
push cx
mov ax, [bp + 4]; arg 1
mov dummy_1, ax
mov dummy_2, 0
mov dummy_3, 10
mov bx, 10
.PNDivLoop:
inc dummy_2
cmp ax, bx
jl .PNException
div bx
push dx ;push remainder on the stack
cmp bx, 10000
jne .PNDivLoop
.PNException:
push ax
.PNLoop:
dec dummy_2
pop ax
or ax, 30h
mov dl,al ; move (al) into DL
mov ah,02h ; stdout
call _syscall
cmp dummy_2,0
jne .PNLoop
mov dummy_1, 0
mov dummy_2, 0
mov dummy_3, 0
pop cx
pop bx
pop ax
mov sp, bp
pop bp
ret
_fact: ;PARAM_1, returns to stack
push bp
mov bp, sp
sub sp, 1
push cx
mov ax, [bp + 4]
mov cx, ax
dec cx
.floop:
mul cx
dec cx
jnz .floop
pop cx
mov sp, bp
pop bp
ret
start:
mov param_1,5
push param_1
call _fact
add sp, 2
push ax
call _PrintNumber
mov dl,cl ; move (CL) into DL
mov ah,02h ; stdout
call _syscall
mov ax, 4c00h ;system call number (sys_exit)
call _syscall ;call kernel
end start
[/code]
3 days of learning asm from scratch and working out why some things just plain don't work (I'm looking at you, pesky stack frames that change when calling a procedure). Any tips thatmay speed the process up?
[IMG]http://johnjoemcbob.com/wp-content/uploads/2016/02/honoureditor.gif[/IMG]
Currently running user testing for my final year research project, which focuses on video game analytics.
I would appreciate it if you guys could give it a test and answer a quick questionnaire at the end (takes less than 5 minutes). It involves playing two prototype game levels and using a custom analytic dashboard to review the gameplay.
Due to my research restrictions, unfortunately you must be 18+ years of age to participate.
More information about [URL="http://johnjoemcbob.com/portfolio/honourgame/"]the game[/URL] and about [URL="http://johnjoemcbob.com/portfolio/honoureditor/"]the dashboard[/URL] is available on my site.
[URL="https://drive.google.com/open?id=0B5Bg5G8CxaVTNlM1aWRWZWRxM2M"]Download (Google Drive)[/URL]
Cheers!
Sorry, you need to Log In to post a reply to this thread.