Categories
Personal Interest

Unity VS Unreal

When I think about game development, two companies will come to my mind, Unity, and Unreal, since these are the most popular game engines. When I started to study game development, I had no idea which one I should use because I didn’t know about the two platforms. I ended up using Unity because the project I took over was developed with Unity. So, today I would like to talk about which game engine you should choose.

https://www.gameplaydeveloper.com/unity-vs-unreal-in-the-gaming-industry/

Programming Language

Unreal and Unity are the best game engines obviously. So, in my opinion, the first thing you have to think about is the programming language. Unreal engine is using C++ and Unity is using C#

In case of Unreal, there is blueprint which is a visual script language. So that even though you do not know how to code with C++, you can create a game with a mouse. However, this has very slow execution time. So if yoIn the case of Unreal, there is blueprint which is a visual script language. So that even though you do not know how to code with C++, you can create a game with a mouse. However, this has a very slow execution time. So if you script your game only with blueprint, it is 5 times slower than when you script with C++. So I can say c++ is inevitable for Unreal game development. But, C++ is a pretty complex programming language to learn and get used to it for people who have non-technical backgrounds. Especially when it comes to “pointer”, it is a really difficult concept to understand even for people who have programming experience.

On the other hand, C# used by Unity is a high-level language which means that it is much easier to learn and use. (C++ is an intermediate-level language, close to machine code).

If you don’t have programming experience and learn it from scratch. Unity could be the best option!

Market Places / Assets Store

When you work on game development, it would be good to create all functions from scratch, but you will find yourself using presets or resources because it makes your project much easier.
Of course, the two game engines also provide you presets and resources. You can download it from Market Place for Unreal, or Asset Store for Unity.


Market Place(Unreal): Unreal provides their users with free resource files and it is a really high-quality resource. For example, Epic games share their game sources on Market Place.


Asset Store(Unity): one of the biggest benefits of using Unity is that they have ample amount of presets and resources for their users. Even small team or individual developers check assets store before developing some function to compare the development cost whether it is cheaper when they buy or create themselves. But, unlikely, it is not free.


So, if you have a budget for buying resources, Unity will a good option. Otherwise, if you don’t have allocated budgets, then Unreal will be the best option for you.

Technical Differences

I don’t want to go deep into this topic since it is too difficult to discuss on this blog and with my knowledge. So, simply saying, the biggest differences between two engines are the way of approaching how to make a game.


In order to complete the same task, for example, let’s assume you are creating a game, and you want to change your graphic work. Unity provides you a function that you can make a change (It requires you to do some code works to put changes together). However, the Unreal engine does not provide you a function that you work on the object directly, one way you can do is to put another layer to look like you want.


In this topic, it is up to your preference about how to work on a project. So, if you are looking for a better way of expansion of your work, Unreal would not be the best option for you.

Categories
Capstone Project Tech Knowledge

How to use Nodemailer

One of my tasks for the project I am working on was to create a function that allows users to send an invitation link to their candidates. So, for this functionality, I had to implement “send email” on our web application. In order to achieve the task, I had researched. I found there are two packages: nodemailer and emailjs. Long story short, I decided to use nodemalier because it is free and there is no limit on sending emails (but emailjs, you have to pay to use it or if you are willing to use the free version, it is limited to 200 emails per month).

What is the nodemailer?

Nodemailer

Nodemailer is a module for Node.js applications to allow sending email.

How to implement sending email function with nodemailer?

You might be able to find many video lectures online, but most videos are dealing the function when if it is in the same server(or Port). However, if you working on react, as you already know, the front-end and back-end are running on the different server ports. In my case, the front-end is running on port:3000 and the server is running on port:7000.


So I have to pass JSON data from 3000 to 7000. So, without middleware, you cannot achieve that.


In this case, Axios can be a good solution since you can send the data to the server port with Axios. And, here is the code I implemented:
Write Axios code on your front-end function where you want to evoke sending email

 axios({                               //call axios   method: "POST",
   //set url with your server port
   url:"http://localhost:7000/send",              
   data: {                            //build a data form
    name: emailSubject,               //Send send           
    email: emailAddress,
    messageHtml: emailContext
   }
 }).then((response)=>{                    // Waiting response  
    if (response.data.msg === 'success'){    //display result     
        alert("Email sent, awesome!");            
    }else if(response.data.msg === 'fail'){
        alert(`Oops, something went wrong with`)
    }
})

Server side code:

const express = require('express');         //load packages
const nodemailer = require('nodemailer');

app.use(express.json());

app.post('/send', (req, res)=>{            //catch post send
    console.log(req.body)

    const transporter = nodemailer.createTransport({
        service: 'gmail',
        auth:{
            user: "from email address",
            pass: "password"
        }
    })

    const mailOptions = {
                 //build mail option
        from: "quizbanana467@gmail.com",
        to: req.body.email,       //use data from front-end
        subject: `${req.body.name}`,
        text: req.body.message

    }

    
    //send email
    transporter.sendMail(mailOptions, (error, info) =>{
         //send feedback to front-end        
         if(error){
            console.log(error);
            res.json({msg: 'fail'});     
        }else{
            console.log("good")
            res.json({msg: 'success'});

        }
    })
})

Based on the email service you are using, there would be some limitations so please refer to the official nodemailer site.

//references

mailtrap.io/blog/react-send-mail

Categories
Capstone Project

Project follow up!

As I posted before, I am working on a project for cs467 class at OSU. I t has been a few weeks since my team started. I would like to talk about project status so far including blockers.

What is project about?

Briefly saying, we are creating a web based quiz creating software that allows a user create quiz and send it to candidates, such that can replace survey monkey.

What tech has been used?

We implemented our project with MERN stack ( MongoDB, Express, React, Node Js). For the framework, we are using react-bootstrap. And, we are using Auth and Redux.

What have I done so far ?

Thanks to our teammates, I mostly focus on Front-end of the program like getting data from users and display back to users. At this stage, most to data (limited to page I created) are stored in front-end as an array. This is because, that specific page should not only be able to receive a data from user, but also be able allow user the data in real time. Once, users satisfy with their entry, then data will be save on to server.

Thanks to the our teammates, back-end server is already set. Only left thing is to hook the page with the server.

Beside those technical thing, I also created a brand logo (Check out here)

logo_small.png

What have our teammates done?

They are doing incredible. Before start the project, we separated our task. Myself focus on front-end, one is focus on back-end and another member is like multiplayer since she is working on both sides.

They already set up server and link it with our SW. Most of simple pages were done already, and we are working on major part of our tool such as rendering quiz for candidates, sending invitation for quiz and so on. You will be heard something more about it later (stay tune)

Any blockers?

Working on React is a blocker itself, that is because our experience is limited. And, there are bunch of new packages and some of implementations are changed through the version update. But, our team is handling well those blockers so far by helping and sharing their knowledges.

It takes more time to complete each task than expected, but it seems worth when I see results after those hard working. Can’t wait to see our final result after this quarter.