[ yn / yndd / fg / yume ] [ o / lit / media / og / ig / 2 ] [ ot / hikki / cc / x / sugg ] [ news / rules / faq / recent / annex / manage ] [ discord / scans / mud / minecraft ] [ aurorachan / desuchan / sushigirl / lewd ]

/ot/ - Off-topic

Best board
Email
Subject
Comment
File
:
Password (For file deletion.)

Uboachan's scanlation group Patchy Illusion Team has just released two new Yume Nikki Doujins: In the Shallows and Refrain. You can see all of our previous releases here.

File: 1561215833486.png (1.79 MB, 1680x1050, 1555950293471.png)

 No.19948

What are you dorks working on? Any cool topics in computer science you'd like to share?

 No.19954

File: 1561553180485.jpg (45.02 KB, 637x579, cirnocpp.jpg)

I'm starting out with graphical programming and C++. I'm trying to write a raycaster engine.
My goal is to make a simple gridbased dungeon game that supports textures, movement, items and an automap. After that possibly combat and multiple levels of the dungeon.

I did something very basic following a youtube tutorial but my map is currently just a matrix where I added in objects like walls and the player.
The only collision detection I have is checking every single iteration whetever or not the player would end up in a wall if he moves forward (only forward movement is supported now, left and right only turn the player into that direction)

I'm stumped on two main concerns:
1: is this how it's done? Checking what's going on every single second? I wish I knew how old games like Shin Megami Tensei on the SNES and Wizardry did this.
2: Having the level be a matrix is super simple and I don't know how levels are stored in games usually.

Other than that I'm also not sure if my first experience with C++ should be a program like this. I know C and I'm no stranger to OOP either but I worry that I might miss obvious things you can do simply by not knowing them and thinking of working with C++ as a combination of C and Java.

 No.19955

>>19954
I take it that you want to focus in 2D, tile-based games for now (at least until you finish this project)?

>1: is this how it's done? Checking what's going on every single second? I wish I knew how old games like Shin Megami Tensei on the SNES and Wizardry did this.

Yes, basically you check things every time you update your main loop.
If you read fwd_key as input, you have to immediately check whether you're clashing if the player moves forward 1 tile, and move only if that is false. I think you may learn a thing or two from downloading nethack (or any other hack variant, for that matter). The source is in C, but it's the logic of how things are done what may interest you.

>2: Having the level be a matrix is super simple and I don't know how levels are stored in games usually.

Take this with a grain of salt, but I believe it's not really different from this, other than maybe compressing it and or arranging it in a way that when you load the game from a savestate, it reads what "tile" goes where, where every object was last time you saved, and numbers such as hp, gold, etc. so you end up with some "map" for your tiles, numbers with positions for characters/objects on ground, inventories, stats, switches and other stuff.

 No.19956

>>19954
>I know C and I'm no stranger to OOP either but I worry that I might miss obvious things you can do simply by not knowing them and thinking of working with C++ as a combination of C and Java.

Try looking up stuff like constructor / destructor orders, virtual inheritance, multiple inheritance, friend classes, etc. Some things can be pretty obscure, like how calling virtual functions in constructor always calls base class functions, so if you're seeing weird shit happen that you can't explain, maybe it's a language specification you've never heard of.

Also try reading up about lower-level stuff like how objects are stored in memory, vtables, etc. It's always good to know how these things when you're not working with Java magic.

Overall you'll be okay, it's really just the details that can screw you over.

 No.19957

File: 1561620117353.png (19.3 KB, 625x497, ClipboardImage.png)

dicking around with source related stuff, using the 2013 sdk for a slightly larger project that i've had in my brain for a while, actually, lets just get to the point. working on a game. i'm tired.

 No.19958

>>19957
I'm assuming you're making a first person shooter with Source? Or is it something different?
I only know first person games that use source.

 No.19960

I'm trying to write an AI agent that can beat the best performance on SQuAD 2.0 without using more than 1% of the training data.

 No.19961

>>19954
>>19955

Some interesting concepts that you might want to look into are…

1. Broad-phase collision detection
2. Binary space partitioning (quadtrees for 2D, octrees for 3D, k-d trees for k dimensions)
3. Viewing-frustum culling

As for your questions,

1. Your map can be represented in a lossless image format on disk. An image is essentially a 2D matrix.
2. The relevant parts of your map can be loaded into memory when it is necessary.
3. The parts of the map that are necessary are those that will be visible within the amount of time that it takes to load the next parts of the map into memory. This is a recursive definition that is based on the maximum speed of your viewport and the speed of loading tiles into memory.
4. You can either check every second, which is common, or you can apply a sweep algorithm, treating time as a dimension. For inspiration, look at examples of functional reactive programming in video games.

 No.19962

File: 1562102898763.png (174.26 KB, 810x500, madodailyedit.png)

I've been doing https://www.nand2tetris.org , which is pretty cool so far. I'm also making a generic 2d game engine using pygame, which I'm planning on using to create and release a game within the year, which is almost certainly not going to happen considering that I'm a novice programmer at best and also that who the fuck can do that in six months, but having ridiculous time constraints is probably pretty good for enforcing a work ethic.

 No.20064

>>19962
>nand2tetris

I'm sure this probably accomplishes what it intends to accomplish, but the name alone is a neat summary of why computers are nothing more than an exercise in autism for the sake of autism.

Artillery, missile guidance, census and taxes for large countries… basically autism. That's what computers are actually useful for. Maybe. Everything else people do with them is just way more autism.

OK, that's just my opinion, but come on. How many people who take this course are ever going to do anything with that knowledge? It's less practical than memorizing a phone book, and probably does about the same amount of damage to your mind.

Seriously, the guy who developed Alone in the Dark literally lost the ability to comprehend human speech for weeks in the middle of a programming binge. Just because that doesn't usually happen doesn't mean it isn't doing anything to you. I've never been able to force myself to do any serious programming project, but I am convinced that the little that I did do, along with spending so much time on computers reading and thinking about how they work, set me back years. Years.

I'm a weak person, I'm still half-addicted to this shit, I can't prove anything, YMMV, do what you want, but nand2tetris, wow, TRIGGERED. It's all there. Pure autism. That's it.

 No.20065

>>20064
Programming is fun.
It's abstract thinking and feels more rewarding than mathematics to me.

 No.20066

>>20065
I'm too dumb for programming but I do have a lot of fun trying to come up with beautiful looking things and coming up with interesting interactions using HTML and CSS.

 No.20151

>>20064
Dude take a chill pill.

 No.20155

Thanks to deciding to start ROM hacking GBA Fire Emblem games I've learned how to use assembly and it's helped me optimize my own personal programs. It's also given me something to talk about with my Comp Sci professors. I'm really surprised more people don't try and use it since it helps for both optimizing methods that you have to run over and over as well as just getting a better understanding of what exactly you're doing in higher level languages.
>>19954
I recommend you look into assembly for your main loop, because you really don't want extraneous clock time for each cycle of it.

The one time video games have actually helped me IRL.



[Return][Go to top] [Catalog] [Post a Reply]
Delete Post [ ]
[ yn / yndd / fg / yume ] [ o / lit / media / og / ig / 2 ] [ ot / hikki / cc / x / sugg ] [ news / rules / faq / recent / annex / manage ] [ discord / scans / mud / minecraft ] [ aurorachan / desuchan / sushigirl / lewd ]