#A game I have been making
117 messages Β· Page 1 of 1 (latest)
ok
instead of a random c/system32/cmd.exe?
why is it random
what?
I think you can enable ANSI sequences even in cmd.exe. ENABLE_VIRTUAL_TERMINAL_PROCESSING https://learn.microsoft.com/en-us/windows/console/setconsolemode
dwMode is an unused variable, or am I missing something?
Test.cpp Build 240628
Bugfixes:
- Fixed problem of cursorSel overshooting on second screen
- Fixed problem of actually incorrect null checking on m key checking on zeroth screen
- some more that i forgot
Features:
Power grid!
Now there is a new test element the power siren!
It requires 1 power to work,and when fully working changes color 17 times per cycle!
Also a power source and a power void!
Sources make power according to cfg,voids remove power according to cfg!
In the current world,put the power siren into a medium platform,put the power sources in the two medium platforms,...and the siren doesn't work!
Why?because using a power source to remove power removes power generation,meaning that the power siren got no power!
Replacing the negative cfg power source with the power void makes the siren work at half the speed(because the siren has to share power with the power void.the power void doesn't actually "void" that amount of power.instead you can think of it as a resistor without the heating function or the inductance.the true power drain would be a negative valued power source),8 switches per cycle!
(Of course,if you remove the power drain altogether the siren will get all the power it needs!Hooray!A happy and well-fed power siren is a good power siren!)
amazig
you can try it!
note:because of my speculation,I think that the gui panel 1 has the same problem panel 2 had.
uhh how do i build it again?
g++ -std=c++23 ConsoleApplication1.cpp -o game?
idk,i use a ide and im not a hacker
Hotfix:
- Fixed cursorSel overshooting on first screen
Damn. Bro is already hating on cmd.exe 
it doesnt supplie ansi escape codes so its no good
Test.cpp Build 240629
Bugfixes:
Fixed problem of placing a power needing element of science(portal reference,and no they are called items) onto a platform updates it and causes it to work with full power for one tick
Features:
Batteries!
They work almost like in astroneer,but now batteries uniformly do their business(weighted by rate,instead of like the original game,where they sequentially do their business.however the power values are stored in int and putting a lot of batteries while having little power excess or drain actually leaves you with no batteries at all!(units measured in deciwatts,or deciunits per second,so if you have 1 watt of excess,placing more than 10 batteries will not store the excess)that is actually unintentionally nerfing the "medium silo of small batteries is better than medium battery" thing)
In the current world,if you put a battery and a positie power source onto the grid,the battery will charge up at a rate of one watts.
if you then put any of the three remaining elements of science(because they all consume 10 deciwatts of power,although in different ways) on the platform the battery will stop charging up
if you then remove the positive power source the battery will drain
Hypothesis(not tested yet) if you put the setup yesterday that would result in a half-working power siren and put a full battery on it,the battery will discharge at a rate of one watt and the siren will work fully
(yes,one watt,not half a watt,because the power void is also "working halfly" although you can't see the effects of it working)
(you should instead think in terms of net power,the battery needs to discharge at the rate of one watt because the other parts of the grid are producing 1 watt and consuming two)
It does if you enable them
Test.cpp Build 240630
Bugfixes:
I didn't leave any as far as i found today,soooo
Features:
Player movement and display modes!
Currently there's no gravity and the player moves at a constant speed of 1.
wasdqe to move
You can't move into a occupied space or out of the world height limit
Display modes
Implimented all the rest of the display modes
mode 1 is normal display
mode 2 is under display(think:floor)
mode 3 is above display(think:ceiling)
mode 4 is depth display(in this mode you can't move your cursor.it is meant to be used after there is gravity,to avoid falling into deep pits.you can prevent falling into shallow ones simply by using under display)
are we absolutely sure that heap-unfriendly types like unordered_map<string, vector<vector<vector<unique_ptr<Item> > > > > are required here (I haven't looked at the code too closely, but this stood out in a scan of it)
Oops!
Chunk optimizations will be done...later
Its like minecraft,but chunks never unload
and you dont have to toss snowballs into nether portals
also if these vectors are of known size (which they seem to be, 16 elements) we can skip 3 levels of heap indirection by just making them std::arrays instead
Otherwise, code structure looks pretty solid
Main is sort of terrifying but that's not really unheard of so it's not a big deal
but i lazy(hj)
is main terrifying?
oh.
all those initializations
the initializations are sort of normal, they have to be somewhere
I think it wouldn't hurt for basic readability if the printing to screen was moved into a function
hmm yeah
most projects of this have a main that's a bunch of initializations and then a while loop with a bunch of stuff
I am guilty of the same crimes
yeah right lmao
Test.cpp Build 240702
Bugfixes:
Not fixing cursor position after selecting a item with small slot size in screen 2
Features:
Small printer
Takes 10 deciwatts
Works substantially differently than the original game:first of all the printing time is a cooldown and it instantly prints if put idle for some time
also there is no printing menu,now just put stuff in like in minecraft,order matters.cfg is currently uneditable(tomorrow!) and it functions as a recipe skipper.
the printer also neatly puts products in itsself,instead of littering them on the floor.
The printer doesn't print packages now.(also,yes,platforms can be put on platforms)
In the current world you have a resin and a printer.Putting the resin into the printer and connecting it to the power grid will grant you a medium platform 8 ticks later.
Also added facing to Item,will probably remove,as it is not of any use yet,and will probably never have a use(the only use for it is auto arms,but they dont use their cfg anyways so i dont need a new field)
Memory fixes:later....
Currently the printer makes a small memory leak and wastes [the amount of its recipes] of nulls every tick
laaater after i add saving and loading the memory leak will go away after loading π
not a good way to fix memory leaks though
pretty sure that the computer can handle that
Test.cpp Build 240703
Bugfixes:
Horrible and cursed memory stuff
A memory leak
Nullcheck when displaying screen 2 was not working,everyone thought that that was a feature
Use of a lot of memory because chunks never unload
Pressed space bar when program loads
Features:
Save&load
Currently the program is in load mode,does not actually make a new world,instead reads world data from disk
When a tick passes the world saves itsself
Uses cereal portable binary something to save stuff(so dont ask me about how it works/how to decrypt save file/how to modify save file by outside means,idk,just read/write stuff using cereal)
Now it must be distributed in its folder,with the cereal library and the (empty or not) save and world folder
Known bugs:
Player does not display properly when the world is loaded
Items get lost when being put into themselves(try it with the medium platform A)
The first key press leads to a flash from unknown reason
oh also
Updates are not sent in some cases(e.g printers finishing printing)
Chunks are not automatically unloaded,instead you have to manually reopen the game now(later you will be able to press a key to reload chunks,but still not automatic)
Test.cpp Build 240704
Bugfixes:
Removed polyfill of function I didn't actually use(getch() without underscore)
Fixed screen flickering on first keypress(now press any key to start)
Fixed player.item not being saved in world
Fixed get/setBlock repeating over 16 blocks in height,oooops!
Fixed createChunk not making the top layer of the world,oooooops!
Fixed createChunk incorrect generation
Test.cpp Build 240705
Fixed createChunk incorrect generation
Fixed block operations not having subscript out of range checks(in minecraft:the placing shulker box using dispenser into void crashes game in a version problem)
Features:
A lot of bugfixes
Terrain generation phase one
Tomorrow:Terrain generation phase two
Ores!
Noodle caves!(the current caves are lasagna caves,although actually those arent the ones mentioned in the minecraft update 1.18,instead they are just two types of caves in astroneer)
with vesania and atrox(i think) having thin noodle caves,and other planets having flat noodle caves(will not actually implement those)
actually
will not implement noodle caves
could write like 50 lines of code describing world population and delayed population(population happens after generation,the part of the population outside the chunk gets pre-written into a different type of chunk file,then new chunks check if the different chunk file exist and if they do populate using data in that chunk file)
but no
the current cave system is surprisingly good
ores will be generated using an actual 3d noise map
(current caves are generated using 12 2d noise maps "offset in different heights in both noise space and real space")
Test.cpp Build 240706
Bugfixes:
Powerless update blocking powerful one
Comment incorrectly stating outdated info from before the memory overhaul in the printer code
(and some i forgot)
Features:
Now you can have a power network in a non-platform!Previously I think that that would only update the connecting network of platforms neighboring the non-platform.
Now everything works everywhere,slotted or not!However,non-platforms don't receive electricity updates if not slotted to a platform.(Which is another way of saying "Leave your exo LTE platforms unslotted(in the original game because such platform hasnt beeen implemented yet)"!
(yes,the cpp file,not the zip,get the zip from earlier and replace this cpp file)
oh
oops
forgot to send the perlin thing tho
Same directory as main code
Test.cpp Build 240707
Bugfixes:
Forgot to remove a TODO comment
Features:
Now ores can generate!
Currently they generate uniformly in height
By that point I would just link a repo on github and paste links to the tags/branch/releases
idk github π’
github push request is too verbose
i would have done it if i had command line git
ah ok
might have broken power stuff π
You can just use regular git tho