Archive for September, 2008

Long time no news – So here it is

September 30th, 2008 6 comments
The current two modes for the wallhack

The current two modes for the wallhack

I was quite busy the last days. I’m still learning for my exam on 6th October. It’s physical chemistry – Physics for chemicians. Well I’m not a chemician but chemistry was a course I have chosen additionally to my physics study. I had to chose some and trust me, chemistry was the easiest of all in my opinion.

On the other hand I’m coding in my leasure time on several lua projects. But I have to disappoint you, it’s not the stargate pack.

I’m still with my Poker game and I also started a lua “hack” out of boredome (for personal usage only). It currently has an aimbot and a wallhack. But before you flame me as a “hacker”: I’m none. My intention in coding it is because I can – That’s all. And it’s incredible easy.

The player table. Not finished yet or even functional.

The player table. Not finished yet

To the poker game which I’m coding in Lua: I just added the player boxes. In these boxes you see the player’s cards, their current cash and bets. Again it’s quite impressed by PokerTH which is, obviously, a really cool game.

Ah well: I just started reading some E-Books about super string theory. I’m not really far with it due to the much time it takes but it’s really interesting.

Instead of describing forces or particle as points, it tries to describe them as vibrating strings or branes (imagine branes like a piece of paper you can fold).

The math in it is highly advanced: So far I have seen it uses variation calculus at the beginning then describes the relations between the branes and normal spacetime using differential forms and manifolds. And all in index notation (Physicians like this because it’s easier to see links and short in writing).

You should not consider about trying to understand this theory if you haven’t passed at least 2 or more years of intensive physics study at university. And I’m in 5th semester now (already had 2 years). The book I’m with is by the way Introduction to Superstring Theory by John H. Schwarz. It is supposed to be a 4 lesson lecture to bring a short overview about what string theory is.

Garry’s Mod Garbage Collection causes FPS drops

September 23rd, 2008 11 comments

Two days ago I read about not reusing tables (and other datatypes) in Lua can cause massive FPS drops. I first didn’t want to believe this but now I know it’s real. This also explains an issue I had on my server for months now: My frames per second randomly drop from about 300 to below 10. And that every 5 minutes. The duration of this lag in most cases is around 1 and up to 15 seconds.

The reason for this is the Garbage Collection of Lua. Imagine this the following: You write postcards. Lets say about 2 every 5 minutes. But some are crap so you want to get rid of them – They get into your garbage bin. But your bin can get full of course. So you have to bring it down for waste collection. Lets say this takes 5 minutes: You can’t write 2 more letters during that time: “You lag”.

With GMod Lua this is even worse – It seems Lua does not only bring the garbage down for waste collection: It looks like Lua directly brings it to the next landfill which is miles away – By feet.

You can test this the following way: First of all, rename your addons folder (to make sure no other script interferes).

Now start a new game and enter

lua_run_cl hook.Add("Tick","GC_Makes_FPS_DROP",function() for i=1,10000 do lol = {} end end)

into your console.

Your FPS should be normal now. But wait: Just a few seconds after you entered this your FPS drop to below 1 FPS. And this now every 10 seconds.

What does this script above actually do? Well, remember you writing postcards? The code above writes 1000 postcards on every tick. This means every time the game calculates stuff. This is many hundred, up to thousand times, a second.

“But wait, over 1000*1000 postcards every second – Isn’t that very much?” you might ask now. Well basically yes. It’s much. But remember that these postcards above were empty.
And scripts like Wire,Depthhud and others exactly do similar stuff like my example code. Not so often, but full of data and often enough to call the Garbage Collection at least every 5 minutes.

And seriously doesn’t make a lagging game you stop playing it? For me it does.

Categories: Garry's Mod, Lua Tags: ,

Poker – Again

September 21st, 2008 No comments

Yay, I started coding on the poker table today. Now only the player part and server to client communication is missing. After that I think I can start a beta on my server.

Some information: My VGUI is inspired by the Open-Source poker game PokerTH which is really cool. I haven’t used any resources besides an edited version of their window-logo from them. But since they licensed PokerTH under the GPL (which I will do too) it might be fine for them me copying their logo.

Some other stuff: I’ve learned the half day again about physical chemistry. I had to chose a minor subject at Uni and I took Chemistry. The actual chemistry part was easy. I just learned for the exam and BAM: 1.7. That’s a B+.
But now the next task is physical chemistry. Ok I’m physician and it should be easy for me you might think. And indeed the physics behind it is easy: Thermodynamics and really easy math like \mathrm{d}U = \delta Q_{rev} + \delta W = \frac{\partial{U}}{\partial{T}} \mathrm{dT} + \frac{\partial{U}}{\partial{V}} \mathrm{dV} = S \mathrm{d} T - p \mathrm{d}V (First law of thermodynamics in different forms)
But the professor was really confusing and I was only able to visit half of the lessons. So learning now is hard Frown
But I’m sure I’ll pass this last exam successfully!

I finished the Card-VGUI

September 18th, 2008 6 comments


I just finished the card-vgui for my Poker game I currently code in Lua. The ranking is nearly done, the pot is coded and I thought: Hell yeah, next step will be the VGUI.

Another reason why I did it was because it’s horrible to identify the different cards by e.g. D.Q (Diamonds Queen) or S.7 (Spades Seven) – Just to name some.

Some information about the VGUI: You can resize it without any issues and only those textures which are necessary are saved.

E.g. the suits and only the upper half of the J,Q,K are stored in materials. The rest is done by the VGUI. This probably increases the code of the VGUI from about 30 to 130 lines compared to those which uses every card as imaged directly. But this decreases the size of the necessary textures from several MB to just around 236 kB.

Categories: Blog, Garry's Mod, Lua Tags: , ,

I have perfect color vision

September 17th, 2008 3 comments

According to this website I have perfect color vision.


Sadly I still will need my glasses.

Categories: Blog Tags:

The Ninja Cat

September 16th, 2008 2 comments

I have never seen such a funny thing before:

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

Categories: Blog Tags:

I won a bike!

September 16th, 2008 3 comments

Today I met with my friends at Uni because they needed some help with covariant electrodynamics: How to get T^{00} = \frac{1}{8\pi c}(\vec{E}^2 + \vec{B}^2) out of T^{mn} = \frac{1}{4\pi} (F^{mr} F^n_r - \frac{1}{4} \eta_{mn} F_{rs} F^{rs}) for example (That’s by the way the Electromagnetic stress-energy-tensor)

Suddenly a woman gave us a flier about a lottery: You could win a bike. My friend needed one, the questions were easy so we all took part.

I have to say this day was some kind of special: It’s called HIT (Hochschul Informationstage) which is an information day for new students. Many took part at this lottery, especially young pupil. But they all went off later when the lottery began and you could only win if you were there.

So about 40 people were left, including us four. Nine bikes to win. One of my friend and me put the last fliers into the box and guess what: He was the first who won a bike, I was the third.

Sadly the one of us who really needed the bike hasn’t won anything Frown – But I think I’ll give him the bike for a few bucks since I already have one. It’s anyway a bike for women.

Later I rode to the train station where I left my other bike (about 20 km) and walked home with both. Some people looked suspicious at me. I think they thought I’ve stolen them.

All day bilance: Profit!

Categories: Blog, Physics, University Tags: , , ,


September 13th, 2008 16 comments
Royal Flush: The best in Hold'em you can get

Royal Flush: The best cards in Hold'em

Poker is an awesome game. I especially like Texas Hold’em so I decided to code a poker engine in lua!

It’s currently only finished to the part where everyone gets cards and chips. This was easy.

The current thing which nags me are sidepots: Let’s say A has 100, B has 50 and C has 100. Minimum to bid is 100. So A bids 100, B can’t bid more than 50 so he goes all-in and C just puts the required 100 to fill the pot.

This creates a sidepot for A and C with a total of 2*(100 – 50) = 100 and a pot for B with 3*50 = 150 he can win.

Sounds easy, but is really eating my brain cells. Currently it works for especially the situation I mentioned above. But it fails if A bids 50, B goes all in with 100 and A just calls by filling the pot with 50 more bucks.

I’m sure I can fix this. The only thing I’m really afraid of is coding a GUI for the engine *ugg*

Categories: Garry's Mod, Lua Tags: ,

LaTeX and other cool additions

September 13th, 2008 No comments

I just installed a cool LaTeX addon. It’s called LaTeX for WordPress. What is it good for you may ask?

Well I’m Physicist so I need to write formulas. And LaTeX is a really good typesetting engine with native math support.

For example if I write

\mathrm{Ind}_\gamma (a) = \frac{1}{2\pi\mathrm{i}} \int_\gamma \mathrm{d}z \frac{1}{z-a}

it will look the following way: \mathrm{Ind}_\gamma (a) = \frac{1}{2\pi\mathrm{i}} \int_\gamma \mathrm{d}z \frac{1}{z-a} (That queer formula for example is the Winding Number of a closed curve)
Above you may have seen the other new addition: Syntax highlighting!
How you know I’m also a passionated lua coder. And it’s much more fun to have example codes highlighted.

Categories: Blog Tags: ,

The Large Hadron Collider

September 13th, 2008 8 comments
The tunne of the LHC

The tunnel of the LHC

The Large Hadron Collider or short LHC is a particle Collider which has been build in Geneva, Swiss near the French borders.

It’s the most powerful particle collider yet build by humanity. Why I underlined it? Well, our universe is a much more powerful particle collider. E.g. every second our atmosphere is bombed by particles at billion times higher energy than LHC or every future human build accelerator can reach. These particles come form cosmic background radiation which is everywhere in space.

I recently read about people being scared to death for the LHC creating black holes, strangelets or other exotic matter which could destroy the earth. But seriously: If it could, why does Earth still exist when it’s bombed by an equivalent of 10,000 LHC experiments by cosmic radiation every second? And that for billions of years now.

I just can underline it again: The proton-proton collusions produced by LHC are at an Energies around 14 T eV. Each proton at 7 TeV. This is just 0,0000011214 Joule.
That equals of a Mosquito at 4 km/h (Just transform E = \frac{1}{2} mv^2 and insert the Energy and mass. A mosquite weights around 2.5 mg). But the whole beam of course contains billions of protons. To be exaclty: 283,040,627,000,000 (Equals 0.00000000047 grams of protons). All these protons together come to a total Energy of 317 Mega Joule. An aicraft carrier (88 tons) at 5.6 knots has the same energy.

But to be serious: Just one collusion between one and another proton can create new particles (according to E = mc^2). This is one of the fundamentals of physics. One event has the Energy of 14 TeV (the Mosquito) but all together are the Intensity (Particles created on every collusion)

You can imagine this like the following: Think about a car at 100 km/h on a highway driving into a wall (which holds this single collusion). This collusion now produces something (At LHC new particles). Now think about a billion of cars driving into the wall. The wall can’t resist of course. But every single collusion just equals one discrete Energy where the overall Energy of course is giant.

That’s also why all protons combine in the beam can easily shoot holes into iron plates. But still one single proton is quite harmless.

Think about it.

Categories: Physics Tags: ,