• What are you working on? v19
    6,590 replies, posted
Whats the fastest way to search a sorted list of numbers? Only thing I can thing of to speed up searching would be to store the largest number then based on the number you want to find and the largest number, you would either start from the beginning or end of the list.
[QUOTE=high;32079112]Whats the fastest way to search a sorted list of numbers? Only thing I can thing of to speed up searching would be to store the largest number then based on the number you want to find and the largest number, you would either start from the beginning or end of the list.[/QUOTE]You could probably do some sort of binary search.
[QUOTE=Neo Kabuto;32079146]You could probably do some sort of binary search.[/QUOTE] Entirely forgot about trees. Now to see if I can find a good implementation of a binary tree.
[QUOTE=high;32079251]Entirely forgot about trees. Now to see if I can find a good implementation of a binary tree.[/QUOTE]No need for a tree. Just jump by half of what's left to search each time.
You can do a binary search with worst-case complexity of O(log n) on the list. Start with an interval that encompasses the entire list. Halve the current interval. See which half the number you're searching for lies on, and continue iteration by halving that interval. However if the list is big enough and the numbers in it change smoothly enough, you could try applying Newton's method to the problem and get results even faster. If the numbers changed approximately linearly, it'd be entirely possible to find the result from thousands of numbers within under 5 iterations. edit: the secant method rather than newton's
[img]http://img545.imageshack.us/img545/7652/screenshot2011090216210.png[/img] For some reason when the client requests a sprite and it's sent to the client, there's a chance it might get mixed up with one another.. It's amusing, but ultimately pissing me off because I can't think of any reason for this to be happening.
[QUOTE=Downsider;32077697]You colored me interested, and I've written a raycaster or two before, so I hacked in some fixes. [URL="http://pastehtml.com/view/b5yam8fr5.html"]http://pastehtml.com/view/b5yam8fr5.html[/URL] It's perspective correct now. If you can't find/don't understand the changes I made, just ask :D[/QUOTE] Thanks! I can't believe how relatively easy or quick it is to do one of those. [code]angle = angle%(Math.PI*2);[/code] This clamps the angle between 0 and 360, probably for this [code]var ndist = dist*Math.cos(player.angle-angle);[/code] Which if I'm not wrong fixes the fisheye projection. [code]var mh = canvasHeight*16; var height = Math.max(mh-(mh-(1/hit.dist)*mh), 0);[/code] However, this, I'd love if you could explain, as well as any other changes I might have missed.
Gwen + Detector = [img]http://dl.dropbox.com/u/8063726/yay.png[/img]
[QUOTE=Xeon06;32079663] [code]var mh = canvasHeight*16; var height = Math.max(mh-(mh-(1/hit.dist)*mh), 0);[/code] However, this, I'd love if you could explain, as well as any other changes I might have missed.[/QUOTE] Everything you said was spot on, and that's just a hack that scales everything to a reasonable/visible height and distance based on the screen size. If you remove that and just use hit.dist, everything will be incredibly small and hard to see. Cool raycaster, by the way :D
If I were to be using the id Tech 4 engine ("The doom 3 stuff") when it's GPL'd, would I be able to make games and sell them, and would I be required to give out the source code?
[QUOTE=T3hGamerDK;32079941]If I were to be using the id Tech 4 engine ("The doom 3 stuff") when it's GPL'd, would I be able to make games and sell them, and would I be required to give out the source code?[/QUOTE] Im not sure how GPL is with commercial stuff, but it does require you to release the source. When is the ETA on the id Tech 4?
[QUOTE=T3hGamerDK;32079941]If I were to be using the id Tech 4 engine ("The doom 3 stuff") when it's GPL'd, would I be able to make games and sell them, and would I be required to give out the source code?[/QUOTE] You would be able to sell it and you would be obliged to give the source code to whomever buys it upon their request.
[QUOTE=esalaka;32080183]You would be able to sell it and you would be obliged to give the source code to whomever buys it upon their request.[/QUOTE] But would that only include alterations to the engine? or also the game code?
Does anybody know anything about how TCP packets work, and why I would be getting a ERR_CONNRESET when too much data is being sent through? I wasn't aware there was a max size or anything along those lines..?
[IMG]http://img7.imagebanana.com/img/oxzjyjjm/grav_pred.gif[/IMG] Player gravity prediction (to predict airshots etc.)
So, the creator of [url=http://www.pygame.org/project-PyPortals-1920-.html]this game[/url] contacted us and accused us of stealing his idea. As professional indie developers we of course didn't get intimidated that easily so we politely replied that A) I started working on it earlier and B) it's the dorkly video which we got the idea from. But we couldn't have expected this! [quote=Nuts) <omfgnuts@gmail.com>] 1 September 2011 15:02 ok 1 September 2011 15:34 i will sue you anyway 2 September 2011 22:38 And i'm really serious, you cant use all mario stuff in your games As i'm employee of Nintendo of America, i'm really asking you to stop development, and delete all info from your website[/quote] Gasp! After asking about details, he revealed that he's working at Britain Nintendo as a right hand for Rob Saunders and a part-time programmer. I guess as a part-time programmer for a huge concern you don't need to know how to animate a simple sprite. [quote=From the project page]i dont know how to code, if u can, show an example with any images animating in my game, i'm really stuck with animation. I've read several tutorials, but they wont work, so i'd be really happy if you could help :) [/quote] But of course, maybe he's just pretending to not know how to program, because he's apparently working undercover for someone [url=http://www.mcvuk.com/news/read/rob-saunders-to-leave-nintendo]who left Nintendo 4 months ago![/url] Clearly we were dealing with a mastermind. After a little more back and forth, he decided to turn on spellcheck in an attempt to sound serious. [quote=Nuts) <omfgnuts@gmail.com>]Anyway, my google.code project is started earlier than yours, so just admit that you stole the idea. Or explain it somehow, and you'll be free, or you will get some emails from Nintendo directly That's all. Best Regards. Tim Michael[/quote] Nintendo: They're okay with you stealing their shit as long as you admit that you stole the idea of one of their employees. Then again, maybe this mysterious "Britain Nintendo of America" operates differently than the other Nintendos. [url]http://stabyourself.net/stuff/serious_business.pdf[/url]
I tried to be nice [editline]eh[/editline] Okay correction: I tried to be nice [I]at first[/I]
Which model formats would be good for supporting in my 3D game?
[QUOTE=neos300;32080802]Which model formats would be good for supporting in my 3D game?[/QUOTE] collada?
[QUOTE=neos300;32080802]Which model formats would be good for supporting in my 3D game?[/QUOTE] [url=http://lee.fov120.com/iqm/]IQM[/url] is a great base for anything, really. You could easily roll that into anything you need with some modifications to the code.
Hooray, my mesh smoothing code worked first time! Before: [img]http://i.imgur.com/YIaPq.png[/img] After: [img]http://i.imgur.com/pmmBm.png[/img] Normals are still a bit dodgy, need a better way to calculate them.
[QUOTE=Murkrow;32080650]I tried to be nice[/QUOTE] -snip- I'm confused and dumb.
[img]http://img820.imageshack.us/img820/2343/screenshot2011090218071.png[/img] Fixed all my bugs! High-five, please. The client can now start off literally empty, with no assets like animations, scripts, levels, or images, and it can all stream in from the server with no issues. Hoo-rah!
[QUOTE=Agent766;32081257]You threatened to sue him using a spoofed email.[/QUOTE] You mean the part where it's the guy's email on top and it says my email after To: at the bottom? Because that was sent to me. Jeez. [editline]a[/editline] I sure hope you feel as stupid as that guy right now
[QUOTE=Agent766;32081257]You threatened to sue him using a spoofed email.[/QUOTE] it was the other dude that threatened to sue
[QUOTE=Richy19;32080245]But would that only include alterations to the engine? or also the game code?[/QUOTE] It's GPL, so all code. If it was LGPL it would only include the alterations (Which... would be all of your code anyway, essentially)
[QUOTE=esalaka;32081387]It's GPL, so all code. If it was LGPL it would only include the alterations (Which... would be all of your code anyway, essentially)[/QUOTE] Ahh, also would he not have to release all code to anyone? (not just to the buyers?)
I believe the GPL only makes it mandatory to give source code to those who buy from you. The LGPL only adds the exception that the main product doesn't need to be GPL-compatible and only the source code to a modified library licensed with it has to be released under the LGPL and source provided at request. Ie. If someone buys it, you should just ship the source code with the product for the sake of clarity &#8212; it's mandatory that when a client asks for the source code of your product they need to have the possibility to get the source code for the exact version you sold them.
[img]http://img840.imageshack.us/img840/8171/screenshot2011090218183.png[/img] What's that? Worried about RAM constraints on your mobile device? (or too lazy to make new sprites?) Have no fear, rotation works in the animation editor too now! Today is like, get shit done day, isn't it?
[QUOTE=thelinx;32081340]it was the other dude that threatened to sue[/QUOTE] Sorry, I thought Murkrow was the guy that was threatening. I'm dumb. Oh bad reading, where art thou? [editline]2nd September 2011[/editline] [QUOTE=Murkrow;32081312]You mean the part where it's the guy's email on top and it says my email after To: at the bottom? Because that was sent to me. Jeez. [editline]a[/editline] I sure hope you feel as stupid as that guy right now[/QUOTE] I do. It's that you tried to be nice thing. I was under the impression that you were the other guy.
Sorry, you need to Log In to post a reply to this thread.