THE NEW Miscellaneous Talk That Doesn't Deserve A New Thread Thread Thread (Part 1)

Hey, so yesterday morning I realized I know enough about programming to make very simple 3d raycasting, so here’s that.

Sphere: Cropped Screen 1
Cube:Cropped Screen 2
Edge:Cropped Screen 3

As you may have noticed, I messed up the projection (and don’t know how to fix it), which why that edge looks terrible, it also gets really stretched near the top and bottom of the cameras view.
Its performance is also pretty bad, but that’s not too surprising since it isn’t well coded, and is single threaded, and on the CPU.
At this point, I should probably learn openGL, or just switch to a game engine like unity or godot.

8 Likes

new favorite song
ooga booga

hey @teaking @MechanicalPumpkin, you feel like making some art for a forum game?
pandora horizon to be specific.
oof double post

I’ll see what I can do

Try increasing the resolution it’ll look better

Cropped Screen 4
Here you go, twice the resolution, and 3 times more color depth; It was at a buttery smooth 8 FPS.

amazing I cant believe your fps gets that buttery o.o

It looks better. Did you fix the projection?

Anyone who has experience with GMod gamemode creation…

I was recently trying to create a code for an inventory. My gamemode is called trollbox.

> trollbox/entities/autorun

inv_base
local player = LocalPlayer()

player.Inventory = {}

function GenerateInventory()                      -- Create a 2D array (4x10) called Inventory. In every cell, create a slot.

    for i = 1, 4

    do

        player.Inventory[i] = {}

        for j = 1, 10

        do

            player.Inventory[i][j] = Slot:new(nil, false, nil, 0)

        end

    end

    print("Inventory has been generated!")

end

hook.Add("PlayerSpawn", "GenerateInventory", GenerateInventory)

function InsertItemInInventory(item, amount)

    for i = 1, 4

    do

        for j = 1, 10

        do

            if (player.Inventory[i][j].isStoring == false or player.Inventory[i][j].objectStored == item)

            then

                player.Inventory[i][j]:assignObject(item, amount)

                break

            end

        end

    end

end
inv_slot
-- Meta Class Slot

Slot = {isStoring = false, objectStored = nil, objectQty = 0}

-- Base Class method new

function Slot:new(o, isStoring, objectStored, objectQty)

    o = o or {}

    setmetatable(o, self)

    self.__index = self

    self.isStoring = isStoring or false

    self.objectStored = objectStored or nil

    self.objectQty = objectQty or 0

    return o

end

-- Base Class method assignObject

function Slot:assignObject(objectString, objectAmount)

    if (self.objectStored == nil)                           -- If not storing any object, then add x amount of said object

    then

        self.objectStored = objectString

        self.objectQty = objectAmount

        self.isStoring = true

    elseif (self.objectStored == objectString)              -- If storing the same object, then add the amount to current quantity

    then

        self.objectQty = self.objectQty + objectAmount

    else                                                    -- If not storing the same object, then don't do anything

        return

    end

end

As you can see, inv_slot.lua contains a class called ‘Slot’. I’m trying to access it from inv_base.lua, but the code doesn’t seem to run whatsoever. What am I doing wrong?

Sorry if I’m asking here, but if I post on the GMod Steam forums, I fear I won’t get an answer.

Update: Okay, so it seems that I required to cut those files and paste their content in:

trollbox/gamemode/init.lua

Now, it works!

… or at least in theory.

@hhyyrylainen, just a question about speech synthesis, text to speech, etc. Do you know anything about dictionary databases? I mean, I heard that hackers find passwords by using words from dictionaries, so wouldn’t those speech software actually use dictionaries too? Isn’t there any such thing made in Lua?

I have only heard a little bit about speech synthesis; I haven’t looked into it actively. I think that speech synthesis dictionaries are actually purpose-built. This is because if you take any random English word, you have no clue how to actually pronounce it. So speech synthesis uses dictionaries that has a word and then the associated phonemes that are actually needed to pronounce it. So the speech synthesis software has a phoneme pronouncing engine and then a pre-processing step to convert written English into a list of phonemes that can then be pronounced.

1 Like

Imagine if NPC’s used those to speak.

3 Likes


This reminds me of something, but I can’t put my finger on it…

7 Likes

Don’t worry, they have giantic underwater fire breathing sessile organisms, so they are capable of becoming spacefaring!

Was it removed? I can’t find it

not yet : )

2 Likes

Some people on here seriously cause me physical pain.

Like the one saying that creating a moving aquarium using stone and wood is not any different than how we made submarines.

2 Likes

I for a second thought that someone already posted that on Thrive’s Steam discussions, but then I saw that it was posted for stellaris.

Who knows, perhaps one will appear one day. Hopefully not…

Hopefully*