Java-Gaming.org Hi !
 Featured games (83) games approved by the League of Dukes Games in Showcase (581) Games in Android Showcase (162) games submitted by our members Games in WIP (632) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 Home Help Search Login Register
Pages: [1]
 ignore  |  Print
 What's the next number in the sequence  (Read 2583 times) 0 Members and 1 Guest are viewing this topic.
Riven
« League of Dukes »

« JGO Overlord »

Medals: 959
Projects: 4
Exp: 16 years

 « Posted 2006-11-15 21:49:01 »

I was writing this LOD algorithm and found a certain sequence of values (by trial and error) for culling
the quads in the center, to make place for a higher LOD. Ofcourse the numbers became too hard to
narrow down in the following LODs, so I needed the formula!

So far for the introduction-story, which can be forgotten right away.

For this who like silly math assignments...

Give me the next 2 numbers of this sequence.

 1 `2, 6, 26, 114, ..., ..., etc`

It's a nasty one, and took me 15 minutes. Now I wonder what others come up with

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
zero

Junior Devvie

 « Reply #1 - Posted 2006-11-15 22:49:56 »

one solution should be:

2^(2*n+1) - 2^(n+1) + 2   for n elem |N_0

sorry, I'm to lazy to put in n=4,5

took me also about 15min without a calculator (5 min for the formula and 10 min proof )

would have been faster but I thought of 2^prim(2+n) - .. because you sad it's a nasty one ;-)
Riven
« League of Dukes »

« JGO Overlord »

Medals: 959
Projects: 4
Exp: 16 years

 « Reply #2 - Posted 2006-11-15 23:20:30 »

I started with 1 instead of 0 (because of how the algorithm works).

 1  2 `|N_0 = 2^(2*n+1) - 2^(n+1) + 2|N_1 = 2^(2*n-1) - 2^n + 2`

I solved it during a chat-session about something else, got kinda hard to concentrate.

This is the first time I encountered a numeric-sequence that wasn't too obvious...

I hope it enjoyed your neurons a bit.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
 Games published by our own members! Check 'em out!
ChrisM

JGO Knight

Medals: 8
Projects: 1
Exp: 14 years

Luke...END OF LINE

 « Reply #3 - Posted 2006-11-15 23:51:57 »

OUCH!  Just stubbed my brain....

-Chris

tusaki

Junior Devvie

Medals: 1

In a mad world only the mad are sane.

 « Reply #4 - Posted 2006-11-16 00:16:01 »

that's a nice formula.

now I want an explanation how it works
Riven
« League of Dukes »

« JGO Overlord »

Medals: 959
Projects: 4
Exp: 16 years

 « Reply #5 - Posted 2006-11-16 00:35:32 »

Well.... if I'd say that it's top-secret, I'd lie.

Consider a grid of cells,
with inside it, another grid of smaller cells,
with inside it, another grid of smaller cells,
with inside it, another grid of smaller cells,
etc.

Which 'center cells' inside the LOD should be culled to prevent overlap?
That's what this formula calculates.

BTW, the placement of the lower LOD-grids, is corrected (snapped) by:

 1  2  3  4  5  6  7  8 `for (int lod = 0; lod < lods; lod++){   for (int k = 0; k <= lods; k++)   {      x -= (((xCameraTile >> k) & 1)) << k;      z -= (((zCameraTile >> k) & 1)) << k;   }}`

If there would be a direct formula for that one... I'd be thrilled, but I wouldn't really need it

I create this kind of black-magic code (for me at least) by writing out the LOD-math for a few levels,
then searching for patterns, transforming it into formulas, where the formula's don't make much
sense to me, to be honest. In the documentation I write how I created them.

I just don't have the time to examin what really happens. Not really interested either

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Falken

Senior Newbie

biggidy bong

 « Reply #6 - Posted 2006-11-16 00:42:33 »

Great. Now for your next challenge.
Could you tell me the next 7 numbers in this sequence... http://www.lottery.co.uk/euro-millions.htm
Riven
« League of Dukes »

« JGO Overlord »

Medals: 959
Projects: 4
Exp: 16 years

 « Reply #7 - Posted 2006-11-16 00:44:30 »

4, 8, 15, 16, 23, 42 and the age of your imaginairy friend.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Falken

Senior Newbie

biggidy bong

 « Reply #8 - Posted 2006-11-16 01:05:43 »

LOL. Thanks.  If I win, you can have my Oceanic flight tickets to Los Angeles.
darkprophet

Senior Devvie

Go Go Gadget Arms

 « Reply #9 - Posted 2006-11-16 01:51:33 »

Oh god...not Lost! Its haunting me to this day...

* darkprophet closes ears and runs shouting BLAH BLAH BLAH BLAH BLAH BLAH BLAH

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 Waterwolf (27 views) 2015-05-20 15:01:45 chrislo27 (32 views) 2015-05-20 03:42:21 BurntPizza (68 views) 2015-05-10 15:53:18 FrozenShade (53 views) 2015-05-07 09:11:21 TheLopais (215 views) 2015-05-06 13:36:48 TheLopais (199 views) 2015-05-06 13:35:14 TheLopais (205 views) 2015-05-06 13:33:39 TheLopais (225 views) 2015-05-06 13:32:48 TheLopais (222 views) 2015-05-06 13:31:28 ClaasJG (243 views) 2015-04-30 20:33:25
 Spasi 32x BurntPizza 16x DavidBVal 13x ra4king 12x EgonOlsen 11x theagentd 11x Husk 10x KevinWorkman 9x princec 8x scanevaro 8x opiop65 7x KaiHH 7x revers 6x Riven 6x MrPork 5x SauronWatchesYou 5x
 List of Learning Resources2015-05-05 10:20:32How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org