Noob learns to code in 3 months

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » March 13th, 2018, 8:43 pm

Some more cool settings for the particles

https://streamable.com/gng23

Second game project is starting next week. I really like our idea, hope it will turn out good.
We'll need quite a bit of unrealistic physics. Wrote a quick and dirty test for parts of it today just to get a sense if it's doable. I think it is. Note that the game will look nothing like this once it's done lol

https://streamable.com/lcmo8

We'll also try to make use of some physics engine before resorting to writing all the physics ourselves

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Noob learns to code in 3 months

Post by albinopapa » March 13th, 2018, 11:36 pm

Well, for the benchmarking, I was going to explain, but instead I'll just share.

Code: Select all

//BenchTimer.h

#pragma once

#include <chrono>
#include <limits>
#include <string>

using clock_type = std::chrono::high_resolution_clock;
using time_point = std::chrono::time_point<clock_type>;

class BenchTimer
{
public:
	BenchTimer( std::string Filename );

	void Start();
	void Stop();
	void Update();

	std::string MinTime()const;
	std::string MaxTime()const;
	std::string AvgTime()const;

private:
	void Reset();
	void Log();

private:
	static constexpr size_t reset_interval = 300;
	time_point start, stop;

	float minTime = std::numeric_limits<float>::max();
	float maxTime = std::numeric_limits<float>::min();
	float avgTime = 0.f;
	
	float time_count = 0.f;
	size_t counter = 0;

	std::string logfilename;
};

Code: Select all

//BenchTimer.cpp

#include "BenchTimer.h"
#include <algorithm>
#include <fstream>


BenchTimer::BenchTimer( std::string Filename )
	:
	logfilename( std::move( Filename ) )
{
}

void BenchTimer::Start()
{
	start = clock_type::now();
}
void BenchTimer::Stop()
{
	stop = clock_type::now();
}
void BenchTimer::Update()
{
	const auto dur = std::chrono::duration<float>( stop - start ).count();
	time_count += dur;
	++counter;
	
	minTime = std::min( minTime, dur );
	maxTime = std::max( maxTime, dur );

	if( counter >= reset_interval )
	{
		avgTime = time_count / static_cast< float >( reset_interval );
		Log();
		Reset();
	}
}

std::string BenchTimer::MinTime()const
{
	return std::to_string( minTime );
}
std::string BenchTimer::MaxTime()const
{
	return std::to_string( maxTime );
}
std::string BenchTimer::AvgTime()const
{
	return std::to_string( avgTime );
}

void BenchTimer::Reset()
{
	counter = 0;
	time_count = 0.f;
	minTime = std::numeric_limits<float>::max();
	maxTime = std::numeric_limits<float>::min();
}

void BenchTimer::Log()
{
	// 
	std::ofstream file( logfilename );

	file << logfilename << '\n' 
		<< "Min frame time: " << MinTime() << '\n'
		<< "Max frame time: " << MaxTime() << '\n'
		<< "Avg frame time: " << AvgTime() << std::endl;

}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

nG Inverse
Posts: 115
Joined: April 27th, 2012, 11:49 pm

Re: Noob learns to code in 3 months

Post by nG Inverse » March 15th, 2018, 5:53 am

Nice benchmarking class. I'll be using this myself. Thanks!

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Noob learns to code in 3 months

Post by albinopapa » March 15th, 2018, 7:20 am

Thanks, it's quite simplistic and is loosely based on chili's FrameTimer class from the old tutorials.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » May 19th, 2018, 2:40 pm

Presentation of our second game project went reallly well. It seemed well received by the audience and we won a prize for pitch of the year.
Working on this project for 9 weeks has been an absolute blast and the group has been awesome.
It's highly likely we'll continue development over the summer

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » May 23rd, 2018, 3:11 pm

Trailer for the game we're working on

https://www.youtube.com/watch?v=wL6zbFVHheQ

User avatar
krautersuppe
Posts: 91
Joined: September 14th, 2015, 10:58 pm
Location: Istanbul

Re: Noob learns to code in 3 months

Post by krautersuppe » May 23rd, 2018, 8:21 pm

I'm curious.
Is language of instruction english over there? And that of communication among students?
DSU
Discord: dsu1, GitHub: https://github.com/DSpUz

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » May 23rd, 2018, 8:27 pm

It's swedish and english. The teachers will do lectures in english if we ask them to. there's a few english speaking students in our class. In my group there's one english speaker so we do all our meetings etc in english.
But most of the time we speak swedish to each other unless there's an english speaker present in the conversation

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » May 30th, 2018, 5:40 am

The game looks really nice, and it's a nice touch with the tandem physics mechanic in there. Looks like a fun project to work on.
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » June 5th, 2018, 4:19 pm

Thanks chili :)

Yeah it's been fun. Porting it to ps4 is no fun tho :P

Post Reply