Hello again.
If you have read our previous post about Development Cultorios game and MVC in Unity:
http://doctrina-kharkov.blogspot.com/2016/08/cultorios-unity-mvc-tutorial.html
you have noticed that we made separate Controller witch give us a lot of benefits. One of them is ability to automate game testing. We know that Unity provide solution for unit-tests, but it's complicated as finding bugs :). And that's obvious because automated testing is some kind of AI which need deep understanding the problem that is still not resolved with modern computers. It's depends of architecture, AI, game mechanics and lots of things.
This gameplay demonstrate automated movement of a Hero described below.
Reason is simple:
as developer you play exactly right to make everything working, but players are not! They push all the buttons at once and do some kind of random behavior. And there your game came into a case you never test it as developer.
With years we try to do same things during development but always there is a person who crash your game. Of course professional QA will do it better and even find a patters of bugs, know vulnerable parts of your code. But as indie developers we not always have resources to involve such people.
What all of this came to ? Games crash because of Input. If you start your game and do nothing in most cases it works fine, but with input it stuck or crash. And now we have a separate class that send input into a logic.
Idea is simple:
Generate random input instead of use keyboard or controller data. That's it. Most games at development will crash at that simple case.
If we have data from devices handled like this:
protected void Controlled()
{
float h = Input.GetAxis("Horizontal");
if ( Mathf.Abs( h ) != 0f )
{
root.ForwardEvent( EEvents.Move, h);
}
if ( Input.GetButtonDown("Jump"))
{
root.ForwardEvent( EEvents.Jump, null);
}
}
where hero is moved and jump. Randomly generated input will looks like this.
protected void Generated()
{
//Randomly select one of the available input from enum
//Randomly generate data for such input
//Send it to Root
}
We not made such simple case because it bring Hero nowhere and of course it is very limited testing because of full random. We made it much complicated to make behavior of our hero more real:
protected void Generated()
{
mMoveTimer += Time.deltaTime;
if (mMoveTimer > mMovePeriod)
{
mMoveRightLeftTimer += Time.deltaTime;
if ( mMoveRight )
{
root.ForwardEvent( EEvents.Move, 1f );
}
else if ( mMoveLeft )
{
root.ForwardEvent( EEvents.Move, -1f );
}
if ( mMoveRightLeftTimer > mMoveLeftRightPeriod )
{
mMoveLeft = mMoveRight = false;
mMoveRightLeftTimer = 0f;
if ( Random.value > 0.5f )
{
mMoveRight = true;
}
else
{
mMoveLeft = true;
}
mMoveLeftRightPeriod = Random.Range( 1f, 3f );
}
mMoveTimer = 0f;
}
mJumpTimer += Time.deltaTime;
if (mJumpTimer > mJumpPeriod)
{
root.ForwardEvent( EEvents.Jump, 0f );
mJumpTimer = 0f;
}
}
Conclusion:
We select direction of the Hero movement and time which he made such movement. When this time is reached we do it all over again. That's how hero will not stay at same place. Also we add jumping with some period of time. Of course you should write down code for testing, even with some kind of AI that is still not very useful.
Our next solution will be record mini patterns of input and randomly select such recordings. That's how we not need to write down any code. See such tutorial later.
Thanks for reading.


Keep sharing! Regards. Read more about
ОтветитьУдалитьSelenium Training in Chennai | Certification | Online Courses
selenium training in chennai
selenium training in chennai
selenium online training in chennai
selenium training in bangalore
selenium training in hyderabad
selenium training in coimbatore
selenium online training
I’m not that much of an internet reader to be honest but your blogs really nice, keep it up! I’ll go ahead and bookmark your website to come back down the road sap fico certification training in hyderabad
ОтветитьУдалитьi'm guiltless natured you take movement of to self-centeredness in your message. It makes you stand dependancy out from various assistant creators that can't maintain nonsensical environment content recollecting that you. Flip PDF Professional One2up
ОтветитьУдалитьYou've got carried out a loud challenge upon this article. Its absolutely regulate and extremely qualitative. You've got even controlled to make it readable and smooth to make a get accord of of into. You've got a few specific writing adroitness. Thank you as a consequence lots. Syncios Data Recovery Free Download
ОтветитьУдалитьThis sort of booklet continuously moving and I select to go web-based mind-set content material, for that excuse happy to track down extraordinary district to numerous here in the broadcast, the composing is simply on your loving, thank you for the name. Happy Friendship Day Quotes For Love
ОтветитьУдалитьBest content and its very helpful Avina Technologies is one of the best SAP training institutes in Hyderabad, offering advanced SAP SuccessFactors Training in Hyderabad with real-time projects, expert faculty, and dedicated placement support. Our SAP SuccessFactors course is specially designed for freshers, HR professionals, graduates, and working employees who want to build a successful career in cloud-based HR solutions. Located in Ameerpet, Hyderabad, Avina Technologies provides practical-oriented SAP SuccessFactors online training and classroom training with hands-on experience in Employee Central, Recruitment, Performance Management, Onboarding, Payroll, and Workforce Analytics. We focus on industry-based training, live projects, certification guidance, interview preparation, and resume building to help students become job-ready. As a trusted institute for SAP SuccessFactors Training in Ameerpet Hyderabad, we ensure students gain strong technical and functional knowledge through experienced trainers and updated course content. Our flexible training schedules, affordable course fees, and placement assistance make us a preferred choice for SAP training in Hyderabad. Join Avina Technologies today to learn SAP SuccessFactors and grow your career in one of the most in-demand SAP HR modules in the global IT industry.
ОтветитьУдалитьBest content and its very helpful and alsoIf you're searching for top-rated SAP SD institutes in Hyderabad, Avina Technologies has built a strong reputation for delivering industry-focused SAP training. With our career-oriented approach, personalized mentoring, real-time project exposure, and dedicated placement support, we have helped hundreds of students secure SAP roles in leading companies.
ОтветитьУдалитьAs one of the best SAP SD training institutes in Hyderabad, Avina Technologies doesn't just teach SAP SD concepts—we prepare you for real-world success through hands-on training, interview preparation, resume building, and continuous career guidance. Whether you're a fresher or a working professional, Avina Technologies is committed to helping you build a successful SAP career.
Avina Technologies is also known for its top-rated SAP ABAP coaching centers in Hyderabad, offering expert-led sessions, updated course materials, and one-on-one mentoring. We are located in Ameerpet – the heart of Hyderabad’s IT training hub – making access easy for students from across the city.
ОтветитьУдалитьFor those seeking remote learning, we provide the best SAP ABAP online training in Hyderabad Ameerpet, with interactive live classes, recordings, and ongoing doubt-clearing sessions. Our trainers bring over a decade of real-time SAP industry experience, ensuring every student gets practical exposure.
Whether you aim to get placed in a top MNC or upgrade your current skill set, our SAP ABAP course is designed to deliver results.